【发布时间】:2015-08-14 07:53:39
【问题描述】:
我有一个基于 php 的网站....我尝试使用 ssl...ssl 在网站上工作正常,问题是它没有使用 https 重定向....它只显示 http 我尝试在 .htaccess 文件中进行编辑,但它不起作用.... 我的网站也以这种格式打开 example.org/index.html with /index.html
我尝试使用它,但无法正常工作
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
.ht访问代码:
RewriteEngine On
RewriteBase /
#AuthUserFile /home/products/html/path/.htpasswd
#AuthGroupFile /dev/null
#AuthName "Private Area"
#AuthType Basic
#<Limit GET POST>
#require valid-user
#</Limit>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=31536000, Public"
</IfModule>
</FilesMatch>
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+).html$ $1/?%{QUERY_STRING}
-------urls---------
RewriteRule ^index/$ path/index.php
RewriteRule ^index/([^\/]+)/$ path/index.php?list=$1&%{QUERY_STRING}
【问题讨论】: