Welcome Guest, Not a member yet? Register   Sign In
using error_404.php to handle 301 redirect
#1

[eluser]Unknown[/eluser]
hi,

i have this PHP site migrated to CI framework, and the main concern is to retain the page ranking from search engine which I need the 301 redirect for old URL to the new URL (for CI).

the problem is, the paged rank URLs from the old site is too many to put in the .htaccess file. for this, i'm planning to use the error_404.php page to handle the 301 redirect which will be done thru the following steps below :

1. import all the old URLs into a database table with each corresponding new URL under CI
2. from the error_404.php, i'll try to catch the URI by using $_SERVER['REQUEST_URI'] function, then matched the URI string from the database table (step 1)
3. if the URI string is found in the database table of old URLs, perform a 301 redirect of the corresponding new URL using the header() function; if not, perform 301 redirect to the site's homepage

my question is, is my way of doing things, correct? if so, will this not affect page ranking from search engine? or how this will affect page ranking of the site?

really need inputs and advice from everyone.

thank you


Messages In This Thread
using error_404.php to handle 301 redirect - by El Forum - 08-18-2010, 11:52 PM
using error_404.php to handle 301 redirect - by El Forum - 08-23-2010, 10:47 AM
using error_404.php to handle 301 redirect - by El Forum - 08-23-2010, 11:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB