K
K
kimqar1232021-04-19 17:30:05
1C-Bitrix
kimqar123, 2021-04-19 17:30:05

Htaccess and Bitrix replacing _ with - in the page url?

There is the following code that changes the _ in the url to - But unfortunately this rule also applies to the admin panel. And as a result, the entire admin panel breaks because of this. How to make _ replaced by - only on the site? For example site.ru/primer_primer changed to site.ru/primer-primer Or is there another way?
RewriteRule ^(.*)_(.*)$ /$1-$2 [L,E=uscor:Yes]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-04-20
@kimqar123

RewriteCond %{REQUEST_URI} !^/bitrix/.*$ [NC] 
RewriteRule ^(.*)_(.*)$ /$1-$2 [L,E=uscor:Yes]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question