Jump to content

Как не потерять ссылки в поисковике при переходе с 1.4 на 1.5 или 1.5


Recommended Posts

Может кому ещё пригодится

При переходе с кмс prestashop 1.4 или 1.5 на 1.5.Х или 1.6
Меняются ссылки, для примера

/product.php?id_product=4, то теперь URL изменился на /index.php?id_product=4&controller=product

Но не только ссылки на продукты но и все остальное, везде добавляется

&controller=

Для того, что бы не потерять в поисковиках Добавляем в .htaccess
 

Сразу после RewriteEngine on

Добавляем

RewriteCond %{QUERY_STRING} ^id_product=([0-9]*)$
RewriteRule ^product.php$ index.php?id_product=%1&controller=product [L,R=301]

RewriteCond %{QUERY_STRING} ^id_category=([0-9]*)$
RewriteRule ^category.php$ index.php?id_category=%1&controller=category [L,R=301]

RewriteCond %{QUERY_STRING} ^id_cms=([0-9]*)$
RewriteRule ^cms.php$ index.php?id_cms=%1&controller=cms [L,R=301]

RewriteCond %{QUERY_STRING} ^id_manufacturer=([0-9]*)&p=([0-9]*)$
RewriteRule ^manufacturer.php$ index.php?id_manufacturer=%1&p=%1=&controller=manufacturer [L,R=301]
Link to comment
Share on other sites

 

Может кому ещё пригодится

 

При переходе с кмс prestashop 1.4 или 1.5 на 1.5.Х или 1.6

Меняются ссылки, для примера

/product.php?id_product=4, то теперь URL изменился на /index.php?id_product=4&controller=product

Но не только ссылки на продукты но и все остальное, везде добавляется

&controller=

Для того, что бы не потерять в поисковиках Добавляем в .htaccess

 

Сразу после RewriteEngine on

Добавляем

RewriteCond %{QUERY_STRING} ^id_product=([0-9]*)$
RewriteRule ^product.php$ index.php?id_product=%1&controller=product [L,R=301]

RewriteCond %{QUERY_STRING} ^id_category=([0-9]*)$
RewriteRule ^category.php$ index.php?id_category=%1&controller=category [L,R=301]

RewriteCond %{QUERY_STRING} ^id_cms=([0-9]*)$
RewriteRule ^cms.php$ index.php?id_cms=%1&controller=cms [L,R=301]

RewriteCond %{QUERY_STRING} ^id_manufacturer=([0-9]*)&p=([0-9]*)$
RewriteRule ^manufacturer.php$ index.php?id_manufacturer=%1&p=%1=&controller=manufacturer [L,R=301]

Куда проще включить чпу, если на 1,5 переход, там само перенаправит.

для 1,4--1,6 да полезно.

но лучше изначально было чпу включить)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...