Перейти к содержанию
Официальный форум поддержки Simpla

Переезд с http на https, Настройка редиректа.


Рекомендуемые сообщения

Переезжаем с Http на Https.

Настроили ридирект.

 

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /home/t/trechi/palatka-spb.ru-old/public_html/PHP_errors.log
php_value error_reporting 2047
php_value log_errors_max_len 0
 
<Files PHP_errors.log>
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
AddDefaultCharset UTF-8
ErrorDocument 404 /404
ErrorDocument 401 /password.php
RewriteEngine on
 
# Админка теперь по адресу /admin
# RewriteRule    ^admin/?$  admin [L]
 
 
# Каталог товаров
RewriteRule ^catalog/([^/]+)/?$    index.php?module=ProductsView&category=$1 [L,QSA]
RewriteRule ^catalog/([^/]+)/([^/]+)/?$    index.php?module=ProductsView&category=$1&brand=$2 [L,QSA]
 
RewriteRule ^products/([^/]+)/?$    index.php?module=ProductView&product_url=$1 [L,QSA]
RewriteRule ^products/?$    index.php?module=ProductsView [L,QSA]
 
RewriteRule ^brands/([^/]+)/?$    index.php?module=ProductsView&brand=$1 [L,QSA]
RewriteRule ^brands/([^/]+)/page_([^/]+)/?$    index.php?module=ProductsView&brand=$1&page=$2 [L,QSA]
 
# Поиск товаров
RewriteRule ^search/([^/]+)/?$    index.php?module=ProductsView&keyword=$1 [L,QSA]
RewriteRule ^search/?$    index.php?module=ProductsView [L,QSA]
 
# Сравнение
RewriteRule ^compare/?$ index.php?module=CompareView [L,QSA]
RewriteRule ^compare/([^/]+)/?$ index.php?module=CompareView&id=$1 [L,QSA]
RewriteRule ^compare/delete/([^/]+)/?$ index.php?module=CompareView&id=$1&action=delete [L,QSA]
 
# Блог
RewriteRule ^blog/([^/]+)/?$    index.php?module=BlogView&url=$1 [L,QSA]
RewriteRule ^blog/?$    index.php?module=BlogView [L,QSA]
 
# Корзина и заказы
RewriteRule ^cart/?$    index.php?module=CartView   [L,QSA]
RewriteRule ^cart/([^/]+)/?$    index.php?module=CartView&add_variant=$1  [L,QSA]
RewriteRule ^cart/remove/([^/]+)/?$    index.php?module=CartView&delete_variant=$1  [L,QSA]
RewriteRule ^order/([^/]+)/?$    index.php?module=OrderView&url=$1  [L,QSA]
RewriteRule ^order/?$    index.php?module=OrderView  [L,QSA]
 
# Для пользователей
RewriteRule ^user/login/?$    index.php?module=LoginView  [L,QSA]
RewriteRule ^user/register/?$    index.php?module=RegisterView  [L,QSA]
RewriteRule ^user/logout/?$    index.php?module=LoginView&action=logout  [L,QSA]
RewriteRule ^user/password_remind/?$    index.php?module=LoginView&action=password_remind  [L,QSA]
RewriteRule ^user/password_remind/([0-9a-z]+)/?$    index.php?module=LoginView&action=password_remind&code=$1  [L,QSA]
RewriteRule ^user/?$    index.php?module=UserView  [L,QSA]
 
# Google sitemap
RewriteRule ^sitemap.xml?$    sitemap.php  [L,QSA]
 
# XML
RewriteRule ^yandex.xml?$    yandex.php  [L,QSA]
 
# XML
RewriteRule ^google.xml?$    google.php  [L,QSA]
 
# feedback
RewriteRule ^contact/?$    index.php?module=FeedbackView  [L,QSA]
 
#downloads
RewriteRule ^order/([^/]+)/([^/]+)/?$    index.php?module=OrderView&url=$1&file=$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=MainView&page_url= [L,QSA]
 
# Ресайз картинок на лету
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^files/products/(.+) resize/resize.php?file=$1&token=%{QUERY_STRING}
#RewriteCond %{THE_REQUEST} ^GET\ (.*)files/products/(.*)\?([A-z0-9]*) 
#RewriteRule ^files/products/(.+) resize/resize.php?file=%2&token=%3 [L,NE]
 
# сжатие text, html, javascript, css, xml:
<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 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
</IfModule>
 
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]


Но что то пошло не так и при переадресации на главную страницу получается дополнительный 
/index.php?module=MainView&page_url=
Подскажите пожалуйста как от него избавится?????
 
 

 

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

У меня так:

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-HTTPS} !1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Ссылка на сообщение
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

Загрузка...
×
×
  • Создать...