How to cut off question mark in url with functions.php

Question

I use directive .htaccess

<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} !^$
RewriteCond %{QUERY_STRING} !(^|&)appId=
RewriteCond %{QUERY_STRING} !(^|&)q=
RewriteRule ^(.+?).html$ https://%{HTTP_HOST}/$1.html? [L,R=301]
</IfModule>

The problem would be solved if this RewriteCond %{QUERY_STRING} !^$ replace with this RewriteCond %{THE_REQUEST} ?

But this directive does not work on the Litespeed server.

How to cut (redirect) to a link without a question mark via function.php?

example:
if open website.com/post-name.html? >>>redirect>>> website.com/post-name.html

Sorry for my English.

0
UserUser-name 3 weeks 2021-12-29T17:07:21-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse