Помощник
|
Вопрос по 301 редиректу и OpenCart |
koroluk1990
|
Сообщение
#1
|
||
|
|
||
|
|||
x64 |
24.9.2015, 22:33;
Ответить: x64
Сообщение
#2
|
|
Редиректите через .htaccess?
Правило http → https должно находиться выше прочих (но, конечно, после RewriteEngine on и RewriteBase, ежели есть) и завершаться RewriteRule с флагом L |
|
|
koroluk1990
|
Сообщение
#3
|
|
это .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 это конфиг Развернуть/Свернуть
Код // HTTP
define('HTTP_SERVER', 'https://lacomfy.com/'); define('HTTP_IMAGE', 'https://lacomfy.com/image/'); // HTTPS define('HTTPS_SERVER', 'https://lacomfy.com/'); define('HTTPS_CATALOG', 'https://lacomfy.com/'); define('HTTPS_IMAGE', 'https://lacomfy.com/image/'); [11:46:18] Маша: это url.php [11:46:19] Маша: <?php class Url { private $url; private $ssl; private $rewrite = array(); public function __construct($url, $ssl = '') { $this->url = $ssl; $this->ssl = $ssl; } public function addRewrite($rewrite) { $this->rewrite[] = $rewrite; } public function link($route, $args = '', $connection = 'SSL') { if ($connection == 'SSL') { $url = $this->ssl; } else { $url = $this->ssl; } $url .= 'index.php?route=' . $route; // $url .= $route; if ($args) { $url .= str_replace('&', '&', '&' . ltrim($args, '&')); } foreach ($this->rewrite as $rewrite) { $url = $rewrite->rewrite($url); } return $url; } } ?> Дополнительных модулей по сео не устанавливали, в админке включили SEO URL - http://joxi.ru/bmokjL3tKERxmy Сообщение отредактировал koroluk1990 - 24.9.2015, 22:50 |
|
|
prain |
24.9.2015, 23:04;
Ответить: prain
Сообщение
#4
|
|
koroluk1990, тоже была такая проблема
вот решение Redirect 301 /steam/oruzhie-csgo/ http://igrobuy.com/oryzhie-cs-go/ RewriteCond %{QUERY_STRING} ^_route_=steam/oruzhie-csgo/$ RewriteRule ^(.*)$ http://igrobuy.com/oryzhie-cs-go/? [R=301,L] |
|
|
koroluk1990
|
Сообщение
#5
|
|
Redirect 301 /steam/oruzhie-csgo/ http://igrobuy.com/oryzhie-cs-go/ RewriteCond %{QUERY_STRING} ^_route_=steam/oruzhie-csgo/$ RewriteRule ^(.*)$ http://igrobuy.com/oryzhie-cs-go/? [R=301,L] Спасибо, но не вариант. Это получается, что для каждой категории, подкатегории нужно делать вручную редирект. А если новая категория появится, то опять все прописывать? Есть ли вариант устранения проблемы более простым путем? Друзья, может кто подскажет. Так и не нашел решение ( UP Уже разобрался. Поправил правила переадресации, перенеся их вверх. На другом форуме подсказали. Как мне объяснили, правила переадресации должны быть выше правил движка, и тогда все будет хорошо. А так у меня все было написано нормально. |
|
|
x64 |
26.9.2015, 10:21;
Ответить: x64
Сообщение
#6
|
|
|
|
|
koroluk1990
|
Сообщение
#7
|
|
|
Подсказали на этом ещё, правда, Вы почему-то не решились воспользоваться подсказкой Не до конца понял подсказку Главное, что все решилось)
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Разработка сайтов Joomla Wordpress Opencart Разработка, верстка, оптимизация веб сайтов. |
77 | WoWeb | 40294 | 3.9.2023, 16:52 автор: Sawich |
|
Техподдержка сайтов на движках Joomla, Netcat, Opencart | 5 | 54web | 4259 | 22.1.2023, 13:27 автор: kikimora17 |
|
Создание интернет-магазинов на CMS OpenCart 3.* Готовое решение, современный дизайн, быстрый запуск! |
0 | M-seo | 2504 | 27.6.2022, 2:01 автор: M-seo |
|
Специалист OpenCart 1.5 / 2.x / 3.x Большой опыт разработки магазинов / сайтов услуг / доработка |
1 | nash | 6041 | 24.11.2021, 16:53 автор: No_signal |
|
Перенос (обновление) OpenCart и OcStore на новую версию 2х - 3х Перенесу ваш магазин на новую версию движка |
3 | Илья1981 | 8420 | 4.10.2021, 11:59 автор: Evgen_ppm |
Текстовая версия | Сейчас: 28.3.2024, 21:40 |