A have a custom website based on apache/php. I also have a wordpress blog and I would like it to be hosted in a different server.
I have tried to create a sub-domine like http://blog.mydomine.com but i would like to keep the old address (http://www.mydomine.com/corp/blog) for SEO purposes. I added the following configuration tu my .htaccess file.
RewriteCond %{REQUEST_URI} ^/corp/blog
RewriteRule ^(.*)$ http://blog.mydomine.com/$1 [L]
I would like to know if I can tell apache not to change the browser address after redirect the request. I know that I could do a 301 redirection but i would prefer to keep the old address.
Any ideas? Thanks in advance!! 🙂
Use the P flag
http://httpd.apache.org/docs/current/rewrite/flags.html#flag_p
You could try a reverse proxy…
This requires mod_proxy be installed and enabled.
Note that this will only work in the following contexts per the apache doc: server config, virtual host, directory – this means that putting it in a htaccess file won’t work.
What you’re wanting isn’t really possible. It’s not Apache that’s displaying the address, it’s the web browser, and there’s no way (thankfully) to tell a web browser “go to site A, but tell the user it’s site B.”
You could fake this behavior using a frame page on your main site, but since you’re wanting this for SEO I don’t think that would help.