【发布时间】:2015-05-29 02:58:00
【问题描述】:
我在 Godaddy 有一个 cPanel 托管帐户,其中包含用于插件域的 SSL。我需要将http重写为https。问题是所有的重写方法都是从 webroot 加载的,而不是包含索引的文件夹甚至是具有重写规则的 htaccess。我知道这个论坛上已经有关于此的主题,但我已经尝试了那些建议的解决方案,这就是我在代码引用中看到的内容,但它们没有用。请不要随意关闭此贴。
webroot (loading this content / not desired)
|
target_directory (htaccess & SSL in question)
以下是发文时完整的htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
#RewriteRule (.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteRule (.*)$ https://emeraldcoast\.rocks/$1 [R,L]
RewriteRule ^([a-zA-Z0-9\-_]+)$ index.php?page=$1
RewriteRule ^([a-zA-Z0-9\-_]+)/$ index.php?page=$1
<filesMatch ".(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "max-age=290304000, public"
</filesMatch>
<filesMatch ".(xml|txt|html|php)$">
AddDefaultCharset utf-8
</filesMatch>
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
【问题讨论】:
标签: .htaccess