A
A
Alexander2021-06-14 14:56:54
htaccess
Alexander, 2021-06-14 14:56:54

Exception in .htaccess rule for slash?

Good day.
CMS Joomla
has a code in htaccess that removes the slash at the end of urls:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L ]

How to make exceptions in this condition for the language prefix.
So that the slash at the end remains in the urls of the form:
https://site.ua/uk/
https://site.ua/en/

and removed in all other cases (this is how it works now):
https://site.ua /uk/page1
https://site.ua/en/page1
https://site.ua/page1

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question