Forum Moderators: phranque

Message Too Old, No Replies

301 redirect

Is there a simple htaccess solution?

         

willybfriendly

8:29 pm on Jul 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am sure that this has been addressed somehwere, but I could not find it in the archives, so please accept my apologies.

I have just converted most of a site over to php. I am wondering if there is a quick solution to redirecting all of the old .htm files to the index page, which is the only remaining .htm file

Trying to avoid the tedium of redirecting all of those pages individually you know :)

WBF

DaveAtIFG

8:35 pm on Jul 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Similar topics have been discussed to death so you have three choices:

1. Start here [webmasterworld.com] and learn how to build your own redirect.

2. Do some more searching.

3. Hope someone posts some code for you.

We discourage number three and prefer to limit discussion to aspects of redirects that have not been previously discussed but you never know...

tschild

10:45 pm on Jul 22, 2003 (gmt 0)

10+ Year Member



Off the top of my head, the following ought to work:

RedirectMatch 301 \.htm$ /

(index.htm would also be redirected this way - not a bug but a feature as [thesite.com...] is anyway a better URL to use than [thesite.com...]

Of course this would mean that people clicking on a link would end up somewhere they did not expect. It would be more elegant if every old page could be redirected to the new page. Is there a simple relationship between old and new URL?