Forum Moderators: phranque

Message Too Old, No Replies

Cobalt Raq and 301 Redirect

why isn't this working?

         

le_gber

9:08 am on Jul 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

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

spud01

11:27 am on Jul 31, 2003 (gmt 0)

10+ Year Member



Try this thread [webmasterworld.com...]

le_gber

11:38 am on Jul 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah read it but think the pb might come from the server itself not from the .htaccess syntax

Leo

tschild

4:51 pm on Jul 31, 2003 (gmt 0)

10+ Year Member



redirectpermanent /index.htm /index.php

I did not find a statement on whether case is meant to be significant in the Apache documentation, but to be on the safe side you might try if RedirectPermanent or Redirect permanent (an older directive) give a better result.

DaveAtIFG

2:39 am on Aug 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From the Apache docs [httpd.apache.org]:
RedirectPermanent directive

This 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."


The description isn't much help to me but in the example, the first parameter is a path (not a URL as you used in your redirect.) So a URL-path seems to be the server path to the directory containing the file you want to redirect. It looks like the path is relative to the site root (%-encoded) but I'm uncertain about this. Try it!

And, if memory serves, Apache directives ARE case sensitive. Use those caps! ;)

le_gber

2:40 pm on Aug 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cheers guys got it sorted (was the access.conf that needed a bit of hints on what to do with the .htaccess file)

I used a RedirectMatch permanent 'cause the pages names remained the same only the extension changed.

Leo