A
A
Art. Ku.2016-06-15 07:17:16
htaccess
Art. Ku., 2016-06-15 07:17:16

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]

Here's how to write these "any characters after the domain"? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Ovchinnikov, 2016-06-15
@kukaew

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 question

Ask a Question

731 491 924 answers to any question