Answer the question
In order to leave comments, you need to log in
How to make an htaccess redirect when a specific url is requested?
Hello. Tell me how to make a redirect to the index.php script when requesting such URLs
domen.ru/page
domen.ru/page?p=123
domen.ru/page/1asd
domen.ru/page/1asd?p=123
Parameters (? p in the example) should also be passed to index.php
I tried this, but for some reason it does not work
RewriteCond %{REQUEST_URI} !^/page(/|$)
RewriteRule ^([^/]*)(/?)+$ /index.php?url=$1 [L]
RewriteRule ^([^/]*)(/?)+$ /index.php?url=$1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question