Циклическая переадресация при force-https
Posted: Thu Apr 16, 2015 2:12 pm
На главных страницах сайта постоянно происходит переадресация с http://******.ru/ на https://******.ru/ и в обратном порядке при обновлении страницы. Стоит движок PrestaShop. Сама же админская панель и отдельные папки, если заходить в них, работают через https нормально, кроме главной деректории сайта. SSL сертификаты встали нормально, проблема, как понимаю, в настройках Apach, nginx и .htaccess, но настроить их я так и не смог, не могу найти, где происходит переадресация
.htaccess
nginx.conf
snginx.conf
sapache2.conf
.htaccess
Code: Select all
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
RewriteEngine on
#Domain: infinit-y.ru
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]
RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
Header add Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
Code: Select all
server {
listen 192.168.1.184:80;
server_name infinit-y.ru www.infinit-y.ru infinit-y-ru.infinit-y.ru;
location / {
rewrite ^(.*) https://infinit-y.ru$1 permanent;
}
}
Code: Select all
server {
listen 192.168.1.184:443;
server_name infinit-y.ru www.infinit-y.ru infinit-y-ru.infinit-y.ru;
ssl on;
ssl_certificate /home/admin/conf/web/ssl.infinit-y.ru.pem;
ssl_certificate_key /home/admin/conf/web/ssl.infinit-y.ru.key;
error_log /var/log/apache2/domains/infinit-y.ru.error.log error;
location / {
proxy_pass https://192.168.1.184:8443;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mp4|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/infinit-y.ru/public_html;
access_log /var/log/apache2/domains/infinit-y.ru.log combined;
access_log /var/log/apache2/domains/infinit-y.ru.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/infinit-y.ru/document_errors/;
}
location @fallback {
proxy_pass https://192.168.1.184:8443;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/admin/conf/web/snginx.infinit-y.ru.conf*;
}
Code: Select all
<VirtualHost 192.168.1.184:8443>
ServerName infinit-y.ru
ServerAlias www.infinit-y.ru infinit-y-ru.infinit-y.ru
ServerAdmin [email protected]
DocumentRoot /home/admin/web/infinit-y.ru/public_html
ScriptAlias /cgi-bin/ /home/admin/web/infinit-y.ru/cgi-bin/
Alias /vstats/ /home/admin/web/infinit-y.ru/stats/
Alias /error/ /home/admin/web/infinit-y.ru/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/infinit-y.ru.bytes bytes
CustomLog /var/log/apache2/domains/infinit-y.ru.log combined
ErrorLog /var/log/apache2/domains/infinit-y.ru.error.log
<Directory /home/admin/web/infinit-y.ru/public_html>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value upload_max_filesize 10M
php_admin_value max_execution_time 20
php_admin_value post_max_size 8M
php_admin_value memory_limit 32M
php_admin_flag mysql.allow_persistent off
php_admin_flag safe_mode off
php_admin_value session.save_path /home/admin/tmp
php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'
</Directory>
<Directory /home/admin/web/infinit-y.ru/stats>
AllowOverride All
</Directory>
php_admin_value open_basedir /home/admin/web:/home/admin/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /home/admin/conf/web/ssl.infinit-y.ru.crt
SSLCertificateKeyFile /home/admin/conf/web/ssl.infinit-y.ru.key
SSLCertificateChainFile /home/admin/conf/web/ssl.infinit-y.ru.ca
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/sapache2.infinit-y.ru.conf*
</VirtualHost>