htaccess internal rewrite across domains?
I'm trying to point a subfolder from one domain to another on my vhost (mediatemple). I want to use internal rewrites, not 301 redirects. Here's the goal
http://www.clientdomain.com/blog/$1 --> http://www.mydomain.com/wpmu/clientdomain/$1
On the server side, the structure looks lik开发者_如何转开发e this:
/x/y/z/domains/clientdomain.com/html/blog/ -- htaccess file is here
/x/y/z/domains/mydomain.com/html/wpmu/ -- wpmu installation
So far I've only had success with 301 redirects, but my goal is to mask things such that wpmu can power the client's blog without revealing its location. Here's my working 301 redirect:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/blog/
RewriteRule ^(.*)$ http://www.mydomain.com/wpmu/clientdomain/$1 [NC]
Is there an easy way to convert it to an internal rewrite? I haven't seen anything but 301 redirects for this type of thing...
Thanks in advance,
Casey
From what I can tell, the only way to achieve this rewrite across vhosted domains is to use a symbolic link between domains to fool mod_rewrite into thinking it's doing an internal rewrite
What you are doing is an internal rewrite.
For a 301 redirect you would have to write [L,R=301]:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/blog/
RewriteRule ^(.*)$ http://www.mydomain.com/wpmu/clientdomain/$1 [L,R=301]
精彩评论