Answer the question
In order to leave comments, you need to log in
How to remove labels in url after 301 redirect?
There is a .htaccess file
DirectoryIndex index.html index.shtml index.pl index.cgi index.php
# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/admin/
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
# HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Answer the question
In order to leave comments, you need to log in
The problem occurs when mod_alias and mod_rewrite are running at the same time
Redirect 301 /oldpage https://site/newpage
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
DirectoryIndex index.html index.shtml index.pl index.cgi index.php
RewriteEngine On
RewriteBase /
# HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
RewriteRule ^oldpage$ https://site.ru/newpage [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/admin/
RewriteRule ^([^?]*)$ /index.php?path=$1 [NC,L,QSA]
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question