Answer the question
In order to leave comments, you need to log in
How to remove html from stock using htaccess?
Hello!
We transferred the store to opencart to an updated version of the engine, the URLs for goods were changed (they ended in .html on the old one). Now you need to redirect the old addresses from html to the same ones, but without the suffix, through htaccess.
Tell me how to do it?
I tried this way, but apparently the condition does not work - the redirect does not occur
# Сначала проверяем корневую категорию. Если это категория товара, обрабатываем правила дальше
RewriteCond %{REQUEST_URI} (.)binty-poliuritanovye/(.*)$ [NC]
# Проверяем, оканчивается ли запрашиваемый url на .html
RewriteCond %{REQUEST_URI} \.html$ [NC]
# Теперь переписываем url, удаляя суффикс
# Выделяем шаблон для обработки, и подставляем её же без html
RewriteRule (.*)\.html$ $1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question