301 Redirect question...

enderz

New member
Jan 13, 2009
727
2
0
Hi,

I failed to find how to redirect all pages that were not found to the home page.

I bought an aged domain that had lots of indexed pages with backlinks to them, I hoped that instead of recreating all the old pages and redirecting them one-by-one to the home page I can do it in one go.

At first I thought just to put a 301 redirect in the 404 not found page, but Im not sure if it'll still pass the link juice.

I'd appreciate some advice here, thanks...
 


Hi,
I bought an aged domain that had lots of indexed pages with backlinks to them, I hoped that instead of recreating all the old pages and redirecting them one-by-one to the home page I can do it in one go.

Use mod_rewrite like this, it redirects files and directories not found to /index.php (change /index.php to your desired target).

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]