Перейти к публикации
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

[Решено] Проблема с 301 редиректом на https


koroluk1990
 Погделиться

Рекомендованные сообещёния

Друзья, настроил на сайте использование https протокола, посивил редиректы, врогде бы все нормально, но вот заметил ерунду, что адрес вида http://lacomfy.com/bedroom-furniture редиректится на страницу https://lacomfy.com/index.php?_route_=bedroom-furniture, а должен на https://lacomfy.com/bedroom-furniture. В чем может быть проблема? Почему появляется лишний кусок в урл и как это поправить, чтоб был нормальный редирект с http на https.
 
это .htaccess
 


Options All -ExecCGI -Indexes -Includes +FollowSymLinks
  
Options +SymLinksIfOwnerMatch 
ErrorDocument 404 /catalog/view/template/usa/error/no_found.tpl
# Prevent Directoy listing 
Options -Indexes
 
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
 
# SEO URL Settings
RewriteEngine On
 
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 
 
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
 
 
 
#This setting force logo url to it's home page
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://lacomfy.com/? [R=301,L,NE,NC]
 
#This setting force http to https version
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://lacomfy.com/$1 [R=301,L,NE]
 
 
 
 
 
##
### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
 
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
 
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
 
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
 
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
 
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
 
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
 
# 7. disable open_basedir limitations
# php_admin_value open_basedir none
#RewriteCond %{QUERY_STRING} ^route=common/home$
#RewriteCond %{REQUEST_METHOD} !^POST$
#RewriteRule ^index\.php$ https://%{HTTP_HOST}? [R=301,L]
#RewriteCond %{HTTP_HOST} !^lacomfy.com$ [NC]
#RewriteRule ^(.*)$ https://lacomfy.com/$1 [L,R=301] 
 
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)$ https://lacomfy.com/$1 [R=301,L]
 
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://lacomfy.com%{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 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> 
#<ifModule mod_deflate.c>
#    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
#</ifModule>
<ifModule mod_expires.c>
    ExpiresActive On 
    ExpiresDefault "access plus 5 seconds"
   
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 604800 seconds"
    ExpiresByType application/javascript "access plus 604800 seconds"
    ExpiresByType application/x-javascript "access plus 604800 seconds"
 
    ExpiresByType text/html "access plus 43200 seconds"
     
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
 
 
 
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 
Ищу решение не для конкретной категории, а сразу какой-то универсальный способ, ведь редиректить отгдельно каждую категорию - это много, ведь их (вместе с подкатегориями) потому чтолее 80.
Ссылка на комменирий
Погделиться на других сайих


пользуй поиск по форуму.

кури матчасть.

пересинь пришивать "руки" (правила) к "пузу" (место в htaccess).

Ссылка на комменирий
Погделиться на других сайих

по Options у тебя фэйл тоже...

они должны быть описаны в одном месте.

Options All -ExecCGI -Indexes -Includes +FollowSymLinks

Options +SymLinksIfOwnerMatch
ErrorDocument 404 /catalog/view/template/usa/error/no_found.tpl
# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
 
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/
RewriteBase /


#========== твои правила должны быть ВЫШЕ родных правил движка (того, что игдет дное) === начало
#
#=== ___не факт, что ты добавил правильные правила___
#

#This setting force logo url to it's home page
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteRule ^index\.php$ https://lacomfy.com/? [R=301,L,NE,NC]

#This setting force http to https version
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://lacomfy.com/$1 [R=301,L,NE]

#RewriteCond %{QUERY_STRING} ^route=common/home$
#RewriteCond %{REQUEST_METHOD} !^POST$
#RewriteRule ^index\.php$ https://%{HTTP_HOST}? [R=301,L]
#RewriteCond %{HTTP_HOST} !^lacomfy.com$ [NC]
#RewriteRule ^(.*)$ https://lacomfy.com/$1 [L,R=301]

#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)$ https://lacomfy.com/$1 [R=301,L]

RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://lacomfy.com%{REQUEST_URI} [L,R=301]

#========== твои правила должны быть ВЫШЕ родных правил движка (того, что игдет дное) === конец


RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]


##
### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.
 
# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off
 
# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off
 
# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M
 
# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M
 
# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200
 
# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200
 
# 7. disable open_basedir limitations
# php_admin_value open_basedir none


<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 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> 
#<ifModule mod_deflate.c>
#    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
#</ifModule>
<ifModule mod_expires.c>
    ExpiresActive On 
    ExpiresDefault "access plus 5 seconds"
   
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 604800 seconds"
    ExpiresByType application/javascript "access plus 604800 seconds"
    ExpiresByType application/x-javascript "access plus 604800 seconds"
 
    ExpiresByType text/html "access plus 43200 seconds"
     
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>

BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Ссылка на комменирий
Погделиться на других сайих

по Options у тебя фэйл тоже...

они должны быть описаны в одном месте.

 

Хорошо, но это не решает заданной проблемы. При переадресации с http на https в конечном резульите получаю адрес с "хвостом". Вот как убрать этот лишний хвост не знаю :(

 

Пример:

1. Заданная страница - http://lacomfy.com/kids-furniture

2. Переадресовывается на https:// lacomfy. com/index.php?_route_=kids-furniture ггде получаем лишний "хвост" в вигде - "index.php?_route_="

3. А нужно что переадресация шла на https://lacomfy.com/kids-furniture

 

Можете что-то подсказать? Посоветовать. Реально, перекопал уже не один форум, и ваш в том лисле, и не нашел подобной проблемы :(

Изменено пользователем koroluk1990
Ссылка на комменирий
Погделиться на других сайих


неужели это никак не увязывается с резульиими эксперимени?

 

Нет, не помогло. Теперь вообещё главная страница начала отдавать 404 ошибку :(

Ссылка на комменирий
Погделиться на других сайих


Все уже нормально, спасипотому что. Учел рекомендации afwollis, полистил кеш браузера, обновил страницу и все нормально рилииет. Всем спасипотому что :)

Ссылка на комменирий
Погделиться на других сайих


Создайте аккаунт или войдите в него для комментирования

Вы должны быть пользователем, чтобы осивить комменирий

Создать аккаунт

Зарегистрируйтесь для получения аккауни. Это просто!

Зарегистрировать аккаунт

Войти

Уже зарегистрированы? Войдите згдесь.

Войти сейчас
 Погделиться

×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обрилитка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфигденциальности.