Answer the question
In order to leave comments, you need to log in
How to write a Mod Rewrite rule?
There is a url
site.xx/GjddfrF
It is
necessary that everything after / be redirected without a redirect to
site.xx/index.php?hash=GjddfrF
When site.xx is opened, site.xx/index.php would be launched and no redirects would occur
. a bunch of other links that shouldn't be redirected either, for example:
http://site.xx/book/
http://site.xx/url/
RewriteRule ^(.*)/?$ index.php?hash=$1 [L,QSA]
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REQUEST_FILENAME} !-f # not a file
RewriteCond %{REQUEST_FILENAME} !-d # not a directory
RewriteCond %{REQUEST_FILENAME} !-s # not a symlink
RewriteCond %{REQUEST_FILENAME} !-l # not a link
RewriteRule ^(. +)$ /index.php?hash=%{QUERY_STRING} [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question