Forum Moderators: phranque

Message Too Old, No Replies

old / new page redirect

Do you have to use full domain

         

wheelie34

9:53 am on Jan 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have done a complete rebuild of a site that was a mixture of pages and directories, after a bit of research this is what I have come up with.

Redirect 301 /old-page.htm [same-domain.com...]

Can I not use the below line

Redirect 301 /old-page.htm /new-folder/new-page.php

Will it work without the [domain.com...]

Thanks

jdMorgan

4:59 pm on Jan 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It might work, depending on the setting of "UseCanonicalName" but you should not rely on this. The documentation for this directive clearly shows a full URL including protocol, domain, and URL-path.

Be aware that you can use Redirect and RedirectMatch to redirect multiple URLs with only one directive, if your concern is keeping the file short. See the Apache mod_alias documentation.

If more sophisticated redirect logic is needed, then see Apache mod_rewrite.

Jim

wheelie34

5:52 pm on Jan 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks jim, but I guess it was worth asking

Cheers