homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

301 redirect for all .asp pages

5+ Year Member

Msg#: 3953131 posted 5:47 pm on Jul 15, 2009 (gmt 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.


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



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

Msg#: 3953131 posted 12:48 am on Jul 16, 2009 (gmt 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.


5+ Year Member

Msg#: 3953131 posted 4:25 pm on Jul 16, 2009 (gmt 0)

ok, thanks.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved