A
A
Artur Lastname2016-03-17 15:55:06
htaccess
Artur Lastname, 2016-03-17 15:55:06

How to get rid of trailing slash in opencart?

Actually the whole point is in the title. He tried to do it himself 20ddcccfee904598bd7e5bb10aae19c2.png
, but unsuccessfully 667195ff3d70442abaeb5ea890ae9c9b.pngGoogled different solutions, but not one came up. Maybe someone has already encountered and knows how to solve this problem without putting additional. modules?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Opencart Pro, 2016-03-18
@OpencartPro

# Необходимо для ЧПУ.

RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/{2,} [NC]
RewriteRule ^(.*) $1 [R=301,L]


RewriteCond %{HTTP_HOST} ^www.site.com$ [NC]
RewriteRule ^(.*)$ http://site.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/ 
RewriteRule ^index\.html$ / [R=301,L] 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ / [R=301,L]

W
web-mechanic, 2016-04-08
@amfetamine

I would try this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/(.*)/$
RewriteRule ^(.*)$ /$1 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question