Multiple ReWriteBase directives in .htaccess?
am 22.02.2010 21:54:45 von Jeff Weinberger--00504502b1c1ce536b048036a544
Content-Type: text/plain; charset=ISO-8859-1
Hi:
I'm trying to figure out a solution to a rewrite (using mod_rewrite) issue
and can't quite seem to get it right. I'm hoping someone here will be
generous with advice.
Situation:
- I've moved my site to a hosting provider who does not allow me access to
the httpd.conf and other configuration files, only to .htaccess
- I have a site (http://example.tld) which also has one subdomain (specified
as an A record, but tried this as a CNAME also) - http://blog.example.tld
- http://blog.example.tld points to {example.tld docroot}/blog
- I want to rewrite all requests to http://blog.example.com/* as
http://example.com/blog/* (that I know how to do and it's working).
In order to do this, I need to have a directive in the .htaccess file in
{example.tld docroot}/blog of "ReWriteBase /"
Problem:
- It's a wordpress blog and wordpress wants its own ReWrite rules in the
..htaccess file.
- Wordpress "knows" it's base URL is http://example.com/blog/
- Wordpress needs the ReWriteBase directive to be "ReWriteBase /blog/"
Question:
Can I have both ReWriteBase directives in one .htaccess file? (I've received
a 500 error every time I've tried, but I may be doing something very wrong)
and if so, how?
If not, is there a better way to handle this? I'm open to suggestion...
Thank you for any help you can offer!
Details:
Apache 1.3.33 on Linux (flavor unclear...hosting provided)
--00504502b1c1ce536b048036a544
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi:
I'm trying to figure out a solution to a rewrite (using mod_=
rewrite) issue and can't quite seem to get it right. I'm hoping som=
eone here will be generous with advice.
Situation:
- I've=
moved my site to a hosting provider who does not allow me access to the ht=
tpd.conf and other configuration files, only to .htaccess
- I have a site (http://example.tld) which also has one subdomain (specifie=
d as an A record, but tried this as a CNAME also) - http://blog.example.tld=
- http://blog.example.tld points to {example.tld docroot}/blog
- I want to rewrite all requests to h=
ttp://blog.example.com/* as http:=
//example.com/blog/* (that I know how to do and it's working).
In order to do this, I need to have a directive in the .htaccess file i=
n {example.tld docroot}/blog of "ReWriteBase /"
Problem:
r>
- It's a wordpress blog and wordpress wants its own ReWrite rules=
in the .htaccess file.
- Wordpress "knows" it's base URL is
e.com/blog/">http://example.com/blog/
- Wordpress needs the ReWriteB=
ase directive to be "ReWriteBase /blog/"
Question:
Can I have both ReWriteBase directives in one .htaccess file? (I've rec=
eived a 500 error every time I've tried, but I may be doing something v=
ery wrong) and if so, how?
If not, is there a better way to handle this?=
I'm open to suggestion...
Thank you for any help you can offer!
Details:
Apache 1.3=
..33 on Linux (flavor unclear...hosting provided)
--00504502b1c1ce536b048036a544--