R
R
rinatoptimus2021-10-15 11:11:07
htaccess
rinatoptimus, 2021-10-15 11:11:07

How to remove parameters when redirecting?

You need to redirect from the page
https://site.ru/blog?start=19
to the page
https://drugoysite.ru/blog/

Rule

RewriteCond %{THE_REQUEST} \s/+blog?start=19[?\s/] [NC]
RewriteRule ^ https://drugoysite.ru/blog/ [L,R=301]


leads to the fact that as a result, the parameter from the original link is added to the drugoysite.ru link. It turns out like this:
https://drugoysite.ru/blog/?start=19
How to make sure that this parameter is not added?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Smirnov, 2021-10-15
@rinatoptimus

Option 1. On the site from which you want to redirect, write in the .htaccess file:
Redirect 301 /blog/ https://drugoysite.ru/blog/
where /blog/ is the page that you want to redirect to the page https://drugoysite.ru/blog/
Option 2. Again, in the .htaccess file on the site with which we configure redirection we write:

RewriteCond %{REQUEST_URI} ^/blog/$
RewriteRule ^.*$ https://drugoysite.ru/blog/? [R=301,L]

I
Ipatiev, 2021-10-15
@Fockker

[NC, QSD]
httpd.apache.org/docs/current/en/rewrite/flags.htm...

D
dodo512, 2021-10-15
@dodo512

RewriteCond %{THE_REQUEST} " /blog\?start=19 "
RewriteRule ^ https://drugoysite.ru/blog/? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question