Answer the question
In order to leave comments, you need to log in
Trimming everything (excluding a couple of "tails") after .html via htaccess?
Good day, experts.
There is this line
RewriteRule ^(.+?)\.html(?!/amp/).+$ https://%{HTTP_HOST}/$1.html [L,R=301]
Answer the question
In order to leave comments, you need to log in
GET is not part of the url and RewriteRule cannot work with it.
In your case, if you need to remove get parameters in general, you can do this
the question at the end of the line will remove the get parameters,
but if you need to work with them, then here is an example of how to do it
# 301 --- http://www.test3.com/faq.html?faq=13&layout=bob => bbq.html
RewriteCond %{QUERY_STRING} (^|&)faq\=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout\=bob($|&)
RewriteRule ^faq\.html$ /bbq.html? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question