Permanent Redirect huge number of url-s via .htaccess or php

Europeuser

I just had to make general changes and had to move all url-s from one php page to another. This caused over 64000 missing url from Google. How can i change the old url like:

www.website.com/shop.php?product=nokia-phones-s5 to new url which is www.website.com/store.php?product=nokia-phones-s5

The only difference is shop.php in url becomes store.php What is better - php redirect and how or .htaccess redirect and how?

Thank you

anubhava

You can use this code in your /phones/.htaccess file:

RewriteEngine On
RewriteBase /phones/

RewriteRule ^shop\.php$ store.php [L,NC,NE,R=301]

Query string is automatically forwarded to new target.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related