Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

database change and unsure of best redirect route to take

redirecting pages from asp database to new php pages

3:39 pm on Feb 10, 2014 (gmt 0)

Junior Member

5+ Year Member

joined:Sept 23, 2008
posts: 45
votes: 0

I have a new client who has a current website (store) that pulls from a database with very long winded query string URLs - they are getting the database redone along with a new CMS in php which will produce static pages with more friendly/relevant page names

Now my issue is that some important URLs are already indexed and show in the results with Google so we need to tell them and others that the page has moved

What's the best way to do this (there are approx 100 category & sub-category pages and hundreds more product pages)?
11:39 pm on Feb 10, 2014 (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
votes: 0

Internally rewrite requests for the old format URLs to a PHP script.

In this PHP script look up the new URL and use the PHP HEADER directive to send a 301 redirect to the correct URL.

Exactly how you look up the new URL is up to you. They could be entries in a PHP array or in a database table.

One other thing to add is where a request resolves to the fix up script, but there is no matching new URL to redirect to, instead return a 404 HEADER and INCLUDE the 404 page.

Bonus functionality: have this PHP script write a log file of requests served, updating to a new filename on a, say, weekly basis. Use it to monitor accesses by search engine bots and to see the fall of in (real) visitor numbers.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members