Forum Moderators: phranque
Just wondering if theres any specific reason why a 301 redirect wont work?
redirect 301 /contact.html [test.example.co.uk...]
thats the only line in my htaccess file, ive uploaded it via ascii and not binary via ftp. The site is definatly on apache..but, when i type in the address for contact.html into the browser, it gives a 404 error, shouldnt it go to the contact.php instead? Is it because its on a subdomain?
thanks
:)
Maybe redirects aren't allowed by your host?
.
In any case, if you simply want to use a .html URL but your file has a PHP script in it, then you can use AddType or AddHandler to set things so that URLs ending in .html are also parsed for PHP content.
No need for any redirects or rewrites in that situation.
[edited by: g1smd at 6:38 pm (utc) on Nov. 14, 2008]
Did you completely flush your browser cache before testing this new code? If not, then your browser will likely show you a cached copy of the (non-existent) page and its associated 404 response, and no request will be sent to your server. So in this case, there is also no way the redirect will work.
Lastly, your host may not have set the Apache AllowOverride and Options directives to allow you to use .htaccess and mod_alias. If not, you can either beg and plead with them, or change hosts.
Jim
Tried that but that didnt work either.
the contact.php works, thats an actual file.
Tried it with a browser that i havent accessed the site with and that returned a 404.
Maybe htaccess is not allowed...will contact my host and see what they say
:)
Jim