Answer the question
In order to leave comments, you need to log in
How to correctly write a redirect in .htaccess mod_rewrite?
Actually, I am not very familiar with mod_rewrite, such a task:
You need to change the page addresses www.domain.com/index.php?mod=smth to www.domain.com/smth/
I read the manuals, I try
RewriteEngine on
RewriteRule ^/([a-z]+)$ index.php?mod=$1 [R=301,L]
RewriteCond %{QUERY_STRING} ^mod=(.*)$ [NC]
RewriteRule ^/$? /%1 [NC,L,R=301]
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