Answer the question
In order to leave comments, you need to log in
How to write RewriteRule gallery?s=blabla -> gallery/blabla?
Hello.
Can you please tell me how to correctly register RewriteRule in htaccess?
It is necessary that when visiting the site.ru/gallery/blabla page, the content is loaded from the site.ru/gallery?s=blabla page.
I tried to do this . Tell me RewriteRule gallery?s\= gallery\/ [L]
how to write it correctly.
Answer the question
In order to leave comments, you need to log in
It's not entirely clear what exactly needs to be done, here are the options.
# 301 --- http://site.ru/gallery?s=blabla => http://site.ru/gallery/blabla
RewriteCond %{QUERY_STRING} (^|&)s\=blabla($|&)
RewriteRule ^gallery$ /gallery/blabla? [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question