-2

My company recently changed it's website, to a brand new one, but in the Google search results, there are specific links, that aren't exist.

I have redirected the 404 error to the index.php, but the url parameters remain there. I don't want any complicated error handling, just redirect the 404 to index.php and remove ANY url parameters.

Thanks for the help!

TomDienes
  • 17
  • 1
  • 2
  • 2
    Possible duplicate of [Redirecting 404 error with .htaccess via 301 for SEO etc](http://stackoverflow.com/questions/2363520/redirecting-404-error-with-htaccess-via-301-for-seo-etc) – jhoepken Mar 31 '16 at 11:32

2 Answers2

0

Hope you are redirecting using .htaccess.

Make 301 redirect.

Jnanaranjan
  • 1,304
  • 15
  • 31
0

Please do not redirect 404 erros wildly! They have a purpose and that is to tell, that this link is not existing. Redirect only old links which do not exists anymore via 301.

In the .htaccess file add something like this:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/oldsite1.php$ [OR]
RewriteCond %{REQUEST_URI} ^/oldsite2.html$ [OR]
RewriteCond %{QUERY_STRING} ^site=old$
RewriteRule ^(.*)$ index.php [R=301,L]

For the syntax of RewriteCondition check the manual.

Fabian N.
  • 1,221
  • 10
  • 18