Forum Moderators: phranque
I want to got to www.mydomain.com/test and it to redirect me to www.mydomain.co.uk/new/testpage.jsp
and
If I go to www.mydomain.com/old/test and it to redirect me to www.mydomain.co.uk/old/oldtest/testpage.jsp
I've tried this
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.mydomain\.co\.uk [NC]
RewriteRule ^/test [mydomain.co.uk...] [R]
RewriteRule ^/old/test [mydomain.co.uk...] [R]
but it just seems to loop as though the rule for /old/test is clashing with the rule for /test
Any ideas
RewriteLog /var/log/httpd/rewrite.log
RewriteLogLevel 9
Fascinating to view..
9 is the highest amount if info available, while 0 is the lowest. Use this for debugging only as there are performance implications to logging rewrites.
Changed it to this and this seemed to sort it.
Probably not the most clever way of doing it but atleast it now works.
Welcome to WebmasterWorld [webmasterworld.com]!
Characters which have special meanings in regular expressions should be escaped by preceding them with a "\", as show for your domain name below.
RewriteCond %{HTTP_HOST} ^www\.mydomain\.co\.uk$ [NC]
Also, you are specifying a 302 Temporary redirect here, so search engines will not update to use the new URL. If you wish them to list your new URLs, then use [R=301].
Jim