【发布时间】:2015-04-10 18:52:04
【问题描述】:
我已尝试关注;
如果用户尝试访问我的网站http://test.com,它将重定向到https://test.com,但如果用户尝试访问像http://test.com/test1 这样的内部页面,它不会重定向到https。我在 .htaccess 文件中尝试了以下代码。
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
完整的 .htaccess 文件
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</IfModule>
【问题讨论】:
-
@Marc 我确实检查过了,但这并没有解决我的问题
标签: php wordpress .htaccess mod-rewrite redirect