G
G
god_we_trust2018-02-28 14:03:21
htaccess
god_we_trust, 2018-02-28 14:03:21

Htaccess, I don’t know how to remove the 302 redirect, but the 301 redirect is not set, what should I do?

Good afternoon! please help me to deal with the problem: The site metaldetector.bel has a lot of 302 redirects. I would like to remove them, the only question is where did they come from. Logically, I searched in htaccess, but did not find anything. 301 redirects do not work (like Redirect 301 /catalog/discounts.php https://xn--80aibca4adafyeyqgc.xn--90ais/catalog/c... I throw the body of the file, tell me pliz:

RewriteEngine On
# php_flag display_errors on
# php_flag display_startup_errors on
AddDefaultCharset UTF-8
ErrorDocument 404 /404
ErrorDocument 401 /password.php
RewriteEngine on
#RewriteBase /

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]



# Кэширование / поддерживается не на всех хостингах
<ifmodule mod_expires.c>
    <filesmatch "\.(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
        ExpiresActive on
        ExpiresDefault "access plus 7 days"
    </filesmatch>
</ifmodule>

# Gzip сжатие / поддерживается не на всех хостингах
<ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/css
    <ifmodule mod_setenvif.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    </ifmodule>
</ifmodule>


# Google PageSpeed Insights модуль PageSpeed,есть не на всех хостингах и не везде может работать, нужно уточнять у хостеров
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedRewriteLevel CoreFilters
ModPagespeedEnableFilters make_google_analytics_async
ModPagespeedEnableFilters prioritize_critical_css
ModPagespeedEnableFilters defer_javascript
ModPagespeedEnableFilters sprite_images
ModPagespeedEnableFilters convert_png_to_jpeg,convert_jpeg_to_webp
ModPagespeedEnableFilters collapse_whitespace,remove_comments
</IfModule>

# Админка теперь по адресу /backend
RewriteRule	^admin/?$  backend [L]

# Каталог товаров
RewriteRule ^([a-z]{2}/)?catalog/([^/]+)/?$	index.php?module=ProductsView&category=$2&lang_label=$1 [L,QSA]
#RewriteRule ^([a-z]{2}/)?catalog/([^/]+)/([^/]+)/?$	index.php?module=ProductsView&category=$2&brand=$3&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?catalog/([^/]+)	index.php?module=ProductsView&category=$2&lang_label=$1 [L,QSA]

RewriteRule ^([a-z]{2}/)?products/([^/]+)/?$	index.php?module=ProductView&product_url=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?all-products/([^/]+)/?$	index.php?module=ProductsView&lang_label=$1&page_url=all-products [L,QSA]
RewriteRule ^([a-z]{2}/)?all-products/?	index.php?module=ProductsView&lang_label=$1 [L,QSA]

RewriteRule ^([a-z]{2}/)?brands/?$	index.php?module=BrandsView&lang_label=$1 [L,QSA]
#RewriteRule ^([a-z]{2}/)?brands/([^/]+)/?$	index.php?module=ProductsView&brand=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?brands/([^/]+) index.php?module=ProductsView&brand=$2&lang_label=$1 [L,QSA]

# Поиск товаров
RewriteRule ^([a-z]{2}/)?search/([^/]+)/?$	index.php?module=ProductsView&keyword=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?search/?$	index.php?module=ProductsView&lang_label=$1 [L,QSA]

# Блог
RewriteRule ^([a-z]{2}/)?blog/([^/]+)/?$	index.php?module=BlogView&url=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?blog/?$	index.php?module=BlogView&lang_label=$1 [L,QSA]

# Рзбранное
RewriteRule ^([a-z]{2}/)?wishlist/?$	index.php?module=WishlistView&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?wishlist/([^/]+)/?$	index.php?module=WishlistView&id=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?wishlist/delete/([^/]+)/?$	index.php?module=WishlistView&id=$2&action=delete&lang_label=$1 [L,QSA]

# Сравнение
RewriteRule ^([a-z]{2}/)?comparison/?$	index.php?module=ComparisonView&lang_label=$1  [L,QSA]

# Корзина и заказы
RewriteRule ^([a-z]{2}/)?cart/?$	index.php?module=CartView&lang_label=$1   [L,QSA]
RewriteRule ^([a-z]{2}/)?cart/([^/]+)/?$	index.php?module=CartView&add_variant=$2&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?cart/remove/([^/]+)/?$	index.php?module=CartView&delete_variant=$2&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?order/([^/]+)/?$	index.php?module=OrderView&url=$2&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?order/?$	index.php?module=OrderView&lang_label=$1  [L,QSA]

# Для пользователей
RewriteRule ^([a-z]{2}/)?user/login/?$	index.php?module=LoginView&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?user/register/?$	index.php?module=RegisterView&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?user/logout/?$	index.php?module=LoginView&action=logout&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?user/password_remind/?$	index.php?module=LoginView&action=password_remind&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?user/password_remind/([0-9a-z]+)/?$	index.php?module=LoginView&action=password_remind&code=$2&lang_label=$1  [L,QSA]
RewriteRule ^([a-z]{2}/)?user/?$	index.php?module=UserView&lang_label=$1  [L,QSA]

# Google sitemap
RewriteRule ^([a-z]{2}/)?sitemap.xml?$	sitemap.php?lang_label=$1  [L,QSA]

# XML
RewriteRule ^yandex.xml?$	yandex.php  [L,QSA]

# feedback
RewriteRule ^([a-z]{2}/)?contact/?$	index.php?module=FeedbackView&lang_label=$1  [L,QSA]

#downloads
RewriteRule ^([a-z]{2}/)?order/([^/]+)/([^/]+)/?$	index.php?module=OrderView&url=$2&file=$3&lang_label=$1  [L,QSA]

# Статические страницы
RewriteRule ^([a-z]{2}/?)?/?$	index.php?module=MainView&page_url=&lang_label=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z]{2}/)?([^/]+)/?$ index.php?lang_label=$1&module=PageView&page_url=$2 [L,QSA]

# Статические страницы
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/?$	index.php?module=PageView&page_url=$1 [L,QSA]

#RewriteRule ^([^/]*)/?$	index.php?module=PageView&page_url=$1 [L,QSA]
#RewriteRule ^/?$	index.php?module=MainView&page_url= [L,QSA]

# Ресайз картинок на лету
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#resizing_image
RewriteRule ^files/(.+)/(.+) resize/resize.php?object=$1&file=$2&token=%{QUERY_STRING}
##resizing_image

<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 35.0.0.0/8

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question