Welcome to WebmasterWorld Guest from 54.167.83.224

Forum Moderators: incrediBILL

Message Too Old, No Replies

301 redirect for all .asp pages

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

New User

5+ Year Member

joined:Aug 1, 2008
posts: 29
votes: 0


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 July 16, 2009 (gmt 0)

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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 July 16, 2009 (gmt 0)

New User

5+ Year Member

joined:Aug 1, 2008
posts:29
votes: 0


ok, thanks.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members