Forum Moderators: phranque
e.g.
user clicks on domainname.com redirects to domain.com/name, however, on this particular server when the domainname.com is clicked it'll redirect to domainname.com/homepage (i.e. domain.com) and every link clicked on from then on becomes domainname.com/name, domainname.com/about etc.
I've checked the .htaccess and the code is exactly the same on each server and other redirects doing similar things to different pages work every time, which is bizarre. Said code is:
RewriteCond %{HTTP:Host} ^(www\.domainname\.com)$
RewriteRule (.*) http\://www\.domain\.com/name\.html [L,I,R=301]
Anyone have any idea what this could be?
The code below is the same on all servers, where the redirects DO work, which points to possible errors with the way the server (or indeed the ISAPI_Rewrite) has been set up. Any ideas on what this could be?
Be aware that --at least on Apache-- the hostname in the HTTP_HOST variable can contain an FQDN-format domain name (as in "example.com." with a period appended, or the hostname may have a port number appended, or it may have both, as in "example.com.:80".
Any of these permissible variations would cause your rule to fail (on Apache) because the pattern is end-anchored and makes no provision for them. Also on Apache, the parentheses around the hostname are not needed, since the contained subpattern is neither optional nor is it back-referenced. And the 'target' URL also does not needed escaping of colons, slashes, or periods (again, this may only apply to Apache mod_rewrite).
Jim