Вопрос

The problem

I have the following URL's in google webmaster tools:

http://www.mydomain.com/product-category/attribute_name-value-attribute_name-value

I need to write a rule in .htaccess that puts the # in my URLs, because the blocklayered module only filters with # in the link, like this:

http://www.mydomain.com/product-category#/attribute_name-value-attribute_name-value

The reason

I need this because in webmaster tools there are lots of error 404's from links without #.

Notes

I have friendly URL's activated in my prestashop backoffice.

Prestashop version 1.5.6.1 .

Server: shared hosting with apache.

PS:

Basicly I need to write a rule to redirect all my links without # to the same links with # after the category.

Thanks!

Нет правильного решения

Другие советы

Redirect them from the url with # to the url without #

RewriteRule ^(.+)\/(.*)$ $1#/$2 [R=301, L]

Or if you want to allow only specific characters

RewriteRule ^([\w\-]+)\/(.*)$ $1#/$2 [R=301, L]

Its not tested, but it should give you the idea.

My Solution

Hi, First thanks for your answers, it helped pointed me in the right direction to resolve the issue. For anyone who has the same problem:

RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^mydomain\.com$
RewriteRule ^([\w\-]+)\/([\w\-]+)\-([\w]+)$ "http\:\/\/www\.mydomain\.com\/$1\#\/$2\-$3 [R=301,L,NE]
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top