This is my httpd.conf file for my http://old.example.com :
RewriteEngine on
RewriteBase /
RewriteRule ^login$ http://another.example.com/login [L]
The problem is that although I can redirect to http://another.example.com/login, but the location bar is still showing http://old.example.com/login.
Any idea how to fix this?
If you’re using mod_rewrite in the server or virtual host configuration, you always need to specify the full URL path in your patterns:
Only when used in the per-directory context like in a .htaccess file you just need to specify the relative URL path without the contextual path prefix.
And also try an explicit redirect by setting the R flag:
With that you can also specify a status code: