Welcome to WebmasterWorld Guest from 54.162.240.235

Forum Moderators: incrediBILL

Message Too Old, No Replies

301 redirect for all .asp pages

     
5:47 pm on Jul 15, 2009 (gmt 0)

5+ Year Member



Hi everyone,

Is there a way to add a 301 to my .htaccess file that redirects all pages with an .asp extension to my home page? We just migrated to .php and have a few hundred .asp pages that are still ranking in the SE's. I've added the following line so far...

ErrorDocument 404 http://www.example.com/not-found

But, I don't think this is the best solution.

Thanks.

[edited by: incrediBILL at 6:02 pm (utc) on July 15, 2009]
[edit reason] exemplified URLs, no specifics please [/edit]

12:48 am on Jul 16, 2009 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



There is a way; but it is very bad form to redirect a lot of old URLs to one new URL.

However, you missed a trick here. You could have retained the *same* URLs for all of your content. You could have done that either
- by naming your files as .asp and telling Apache that files with the .asp extension actually contain PHP scripting *or*
- you could have named the files as .php and at the same time retained the URLs shown in links as .asp and then set up an internal rewrite such that requests for .asp URLs are serviced by files with .php names.

This is an important point.

4:25 pm on Jul 16, 2009 (gmt 0)

5+ Year Member



ok, thanks.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month