V
V
vector172020-07-28 05:47:06
htaccess
vector17, 2020-07-28 05:47:06

How to remove "25" or completely "%25" from site url?

Tell me how to remove 25or completely %25from the url of the site? For example, I make a page on the site to lose weight by 50% ?, the address is as follows kak-pohudet-na-50%25?:.

In the webmaster, such a page is indexed as: kak-pohudet-na-50%?
but when I go to this address, it opens: 400 Bad Request
And the re-bypass of such pages also fails, writes: Failed to bypass

I want the address to become like this: kak-pohudet-na-50? or, if the question is longer, it would look like this: kak- pohudet-na-50-i ne-umeret?

.htaccess looks like this:

Options -Indexes
DirectoryIndex index.php
RewriteEngine On
#RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-08-03
@shambler81

RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]

It will be better this way
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php\?qa-rewrite=$0\&%{QUERY_STRING} [L]

here do not forget to escape special characters in the steering wheel, because on some web servers this is required, on some it works like that.
Also, do not forget that RewriteRule does not highlight GET because it is not part of the url,
give the link was in order to understand what exactly the question is, and where this % is originally located in the get or in the url

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question