How to make a redirect correctly in this case?

  • 0
    Now when you move on
    http://ru-biss.ru/drugie_vidy_licenzii/gde_kupit_licenziyu_ohrannika.html

    you get to
    https://ru-biss.ru/drugie_vidy_licenzii/gde_kupit_licenziyu_ohrannika.html?catpage=drugie_vidy_licenzii&whatpage=gde_kupit_licenziyu_ohrannika

    but it is necessary that from two such options there was a redirect to
    https://ru-biss.ru/drugie_vidy_licenzii/gde_kupit_licenziyu_ohrannika.html

    There are a lot of such pages, please tell me a solution on how to do it correctly through .htaccess in bulk for all pages.
    Here is the current .htaccess code:
    AddDefaultCharset utf-8
    <Files ".htaccess">
    deny from all
    </Files>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    ErrorDocument 404 /404.html
    #
    RewriteRule ^index.html$ /$1 [L,R=301]
    
    # admin
    RewriteRule ^admin/$ admin/index.php
    RewriteRule ^admin.html$ admin/index.php
    RewriteRule ^admin$ admin/index.php
    RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ ?catpage=$1&whatpage=$2
    
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/robots\.txt$
    RewriteCond %{HTTP:X-Forwarded-proto} !^https$
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    RewriteCond %{HTTP_HOST} ^www\.(.*)$
    RewriteRule ^(.*)$ https://%1/$1 [L,R=301]

    If you take away from it
    RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ ?catpage=$1&whatpage=$2

    then the whole site flies away in 404
    htaccess Rhys Jackson, Sep 23, 2020

  • 1 Answers
  • 0
    AddDefaultCharset utf-8
    <Files ".htaccess">
    deny from all
    </Files>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    ErrorDocument 404 /404.html
    #
    RewriteRule ^index\.html$ / [L,R=301]

    RewriteCond %{REQUEST_URI} !^/robots\.txt$
    RewriteCond %{HTTP:X-Forwarded-proto} !^https$
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    RewriteCond %{HTTP_HOST} ^www\.(.*)$
    RewriteRule ^(.*)$ https://%1/$1 [L,R=301]

    # admin
    RewriteRule ^admin(/|\.html)?$ admin/index.php [L]

    RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?catpage=$1&whatpage=$2 [L]
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!