Forum Moderators: phranque

Message Too Old, No Replies

permanent redirect "catchall"

permanent redirect "catchall"

         

hotwired

9:42 am on Oct 17, 2007 (gmt 0)

10+ Year Member



Hi
I have just taken over a website that was JUST revamped with all php pages, but on Google, Yahoo, etc. many old htm, html and even some .asp pages are indexed. I did a site:example.com and did 301s in cPanel for the first page that came up, but what I want to do is a "catchall" or modified wild card. I just want ANY page with .asp or .htm or .html to go straight to the homepage, to save me time slogging thru all the errant pages out there. Any thoughts?

[edited by: jdMorgan at 4:12 pm (utc) on Oct. 17, 2007]
[edit reason] example.com [/edit]

jdMorgan

4:19 pm on Oct 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A little prior planning and research might have saved this site weeks to months of depressed search rankings. Just because the filenames change is no reason to change the URLs. It is entirely possible to map (internally rewrite) requests for .html, .html, and .asp URLs to .php files without any effect on users, their bookmarks, or search engines whatsoever.

That said, look into using Apache's mod_alias RedirectMatch and/or mod_rewrite RewriteRule to implement these redirects. We do not provide a "free code-writing service" here, but specific questions about your own code are welcome.

Jim