Answer the question
In order to leave comments, you need to log in
How to redirect via MOD_REWRIT?
Hello.
It is necessary like this: you go, for example, to site.ru/a/b/c/d
, and it loads site.ru?url=a/b/c/d
. In other words, to take any characters after site.ru/
and insert after site.ru?url=
through MOD_REWRIT, a la a beautiful URL.
In .htaccess something like this:
RewriteEngine on
RewriteRule (любые символы после домена) index.php?url=$1 [L]
Answer the question
In order to leave comments, you need to log in
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question