E
E
epiop_512016-11-08 09:30:57
htaccess
epiop_51, 2016-11-08 09:30:57

How to set up a redirect to opencart 2.*** with .html in conda without .html?

This is how it says in xtaccess

RewriteBase /

RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# редирект с хтмл на без хтмл
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^.*$ $0.html [L,QSA]
RewriteCond %{THE_REQUEST} ([^\s]*)\.html(\?[^\s]*)?
RewriteRule (.*) %1 [R=301,L]
# редирект с хтмл на без хтмл ---
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

The redirect works fine on product pages.
But when you enter the admin panel at the standard address, it redirects to this *****/admin/?_route_=admin
And when you click on buy, a huge window pops up with an error in which the html code of the page.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2016-11-10
@ephiop_51

what engine?

E
Egor, 2016-11-08
@egormmm

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
This is the line and does it. Why is she needed?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question