Forum Moderators: phranque
I've got a dedicated Cobalt Raq and just redesigned my main website with includes and scripting hence .htm became .php and the need to get a 301 permanet redirect working :(
I tried yesterday to put a .htaccess file on the root of the site. It worked: the server picked it up, but the pb is that it gave me server misconfigured errors as I requested the pages, ANY pages.
this is what I had put in the file:
redirectpermanent /index.htm /index.php
I tried with full URL for the second path and I tried redirect 301 and redirect permanent but nothing worked.
I need your help as the server support team don't seem to know where it's coming from (we need to check and we'll get back to you) and I get spiders hits on the old pages.
Thanks
Leo
RedirectPermanent directiveThis directive makes the client know that the Redirect is permanent (status 301). Exactly equivalent to Redirect permanent.
The syntax for either directive is similar:
Syntax: RedirectPermanent URL-path URL
or:
Syntax: Redirect [status] URL-path URL
What's a "URL-path?" I thought you'd never ask! ;) From the Redirect directive description:
URL-path a (%-decoded) path; any requests for documents beginning with this path will be returned a redirect error to a new (%-encoded) URL beginning with URL.
Example:
Redirect /service [foo2.bar.com...]If the client requests [myserver...] it will be told to access [foo2.bar.com...] instead."
And, if memory serves, Apache directives ARE case sensitive. Use those caps! ;)