404 Redirect

Hi there,

I have an Solaris Apache server where there was a web site that was hosted for may years. We decided to give the site a new look and transfer it to a new server the DNS broadcast was also made and the domain was transferred to the new server a VPS V2 Apache. But since google has all the site's pages in its result we get an 404 error page when going to the respective page.

What we want is to create an 404 redirect .htacess file to redirect all the pages to the new server.
LVL 3
www-i-p-muAsked:
Who is Participating?
 
jasonsbytesCommented:
RewriteEngine on
RewriteCond   %{REQUEST_FILENAME}  !-d
RewriteCond   %{REQUEST_FILENAME}  !-f
RewriteRule .* /index.php
0
 
jasonsbytesCommented:
What you want is a 301 permanent redirect.  This will tell google, et al., to update their indexes as well.

This should get you started:
http://www.google.com/search?hl=en&q=apache+mod_rewrite+301+permanent+redirect
0
 
www-i-p-muAuthor Commented:
Thank you for the help jasonsbytes you made me give another though on the situation.

Here is the updated sitution and sorry for the confusion:

on the new server i must make a redirect .htaccess file so that when peple come to any address that give a 404 error page to convert to the index page. So technically if the users come from google a page like this http://domain.com/this_page_does_not_exist.php he will be directed to http://domain.com/index.php. Please also note that we have .php pages that are available for this web site and also we already have an .htacces that rewrites all urls from http://domain.com to http://www.domain.com

Please advise further.
0
 
www-i-p-muAuthor Commented:
Dear jasonsbytes

Thank you for the support,

You gave the code below:

RewriteEngine on
RewriteCond   %{REQUEST_FILENAME}  !-d
RewriteCond   %{REQUEST_FILENAME}  !-f
RewriteRule .* /index.php

do we need to make any modification to the code so that it will correspond to the way i want the redirect to work?

Please advise further

Best Regards
0
 
jasonsbytesCommented:
i don't think so...  should work for you as is.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.