Categories
How to correctly formulate a regular expression for htaccess?
Hello. Please tell me how to write a rule for htaccess so that when you go to such an address news.php?xxxx there is a 301 redirect to just xxxx.html
Answer the question
In order to leave comments, you need to log in
RewriteCond %{QUERY_STRING} ^news.php?(.*)$ [NC] RewriteRule ^(.*)$ %1.html [L,R=301]
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question