Sign in to follow this
Followers
0

Редирект со слешем и без на конце
By
grinkin, 01/23/2016 07:10 PM in Opencart 2.x: Настройка и оптимизация
-
Similar Content
-
By STh
Исходные данные:
Чистая новая установка ocStore 3.0.2.0 на вирт. сервер xampp в локальную папку /shop3/. Включены ЧПУ во вкладке Сервер, во вкладке SeoPro включено "Включить SeoPro" и "ЧПУ товаров с категориями". Все остальные настройки - по-умолчанию. .htaccess активирован, базовый Rewrite - /shop3/ - прописан. Больше ничего не менялось.
Суть проблемы:
ЧПУ работают, категории и товары открываются нормально. Только главная страница выдаёт бесконечный редирект (не открывается). Админка работает без проблем. Если в настройках вкладки SeoPro ещё включить "Добавить слэш в конец ссылки", то всё открывается нормально, включая главную. Но везде в конце URL добавляется слэш. Нужно чтобы работало без этого слэша.
Вопрос:
Как избавиться от бесконечного редиректа главной, не включая конечный слэш? На этом же xampp'е запускается ещё пару магазинов на ocStore 2.x.x.x и блог на Wordpress (в своих подпапках) - там таких проблем нет: можно включать конечный слэш или отключать, всё работает без проблем.
-
By santur
Всем добра! Подключился к яндекс.маркету и сразу же начали появляться ошибки типа: страница недоступна. Сайт хххххх выполнил переадресацию слишком много раз. При этом ошибка при переходе не со всех товаров, а с некоторых. Кто сталкивался с такой проблемой? Подскажите, как решили?
-
By NikRestore
Здравствуйте. Проблема в следующем: Не могу понять, что не так в htaccess - При клике на любую страницу идет переадресация на главную. В чем может быть дело?
ocStore 2.3.0.2.3.
SEO URL + SeoPro (ЧПУ). Без SeoPro тоже самое получается.
SSL заказал у хостера, подключил, в Настройках включил.
Переадресация с http://domain.com/ на https://domain.com/ осуществляется функцией хостинга.
В конфигах корня и админа прописал:
//HTTP define('HTTP_SERVER', 'http://www.domain.com/'); //HTTPS define('HTTPS_SERVER', 'https://www.domain.com/'); .htaccess. Закомментированная строчка должна была делать редирект с обычных урлов на сеошные урлы. Но при ее активации, просто падают стили.
RewriteEngine ON RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L] RewriteRule ^system/download/(.*) index.php?route=error/not_found [L] RewriteCond %{HTTPS} OFF RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{HTTPS} ON RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !\/$ RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\/$ RewriteCond %{REQUEST_URI} !\/[^\/]*\.[^\/]+$ RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301] # RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] <Files .htaccess> Order Allow, Deny Deny from All </Files> Options All -Indexes
-
By yurabr
Здравствуйте.
Вот, что у меня в htaccess:
RewriteEngine On RewriteBase / #Редирект с www to non-www(https) RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] #Редирект с http to https RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.+)/$ RewriteRule ^(.+)/$ /$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/ RewriteRule ^index\.html$ / [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ RewriteRule ^index\.php$ / [R=301,L] RewriteCond %{QUERY_STRING} ^route=common/home$ RewriteCond %{REQUEST_METHOD} !^POST$ RewriteRule ^index\.php$ https://%{HTTP_HOST}? [R=301,L] 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] Больше там ничего нет.
Я, в принципе, не уверен, что он правильный (может кто подправит).
проверял здесь http://www.prcy-info.ru/index.php/redirect-checker
1)
Ссылка: https://мойсайт.ком/каталог
Обнаружен 301 редирект на URL: https://мойсайт.ком/каталог
Это ТАК должно работать?
2)
Ссылка: https://www.мойсайт.ком/каталог/
Обнаружен 301 редирект на URL: https://мойсайт.ком/каталог/
В других случаях слеш убирается, почему не убирается тут?
Спасибо.
-
By Dzimmo
Всем привет! Прошу помощи:
сайт: http://r40271.hostde13.fornex.org/lauterpro/
Не работают ЧПУ в стандартной версии магазина. В админке ЧПУ включены и прописаны для категорий.
При переходе на категорию с прописанным url (http://r40271.hostde13.fornex.org/lauterpro/polotenca) как и положено вставляется ЧПУ, но сервер не заменяет ЧПУ на правильный URL, а выдает 404 ошибку. Перепробовал все варианты, которые нашел на форуме, кэш system/storage/cache удалял.
Содержание файла .htaccess:
# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. # 2. In your opencart directory rename htaccess.txt to .htaccess. # For any support issues please visit: http://www.opencart.com Options +SymLinksIfOwnerMatch # Prevent Directoy listing Options -Indexes # Prevent Direct Access to files <FilesMatch "(?i)((\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt))"> Require all denied ## For apache 2.2 and older, replace "Require all denied" with these two lines : # 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=extension/feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L] RewriteRule ^system/storage/(.*) 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
-
-
Recently Browsing 0 members
No registered users viewing this page.