2015-05-29 28 views
0

我在Godaddy中擁有一個cPanel託管帳戶,並使用SSL作爲插件域。我需要將http重寫爲https。問題是所有的重寫方法都是從webroot加載的,而不是包含索引的文件夾,甚至是包含重寫規則的htaccess。我知道這個論壇已經有一些話題了,但是我已經嘗試了這些建議的解決方案,這就是我在代碼報價中看到的內容,並且他們沒有工作。請不要隨意關閉此線程。如何在htaccess中將http重寫爲https的插件域

webroot (loading this content/not desired) 
     | 
     target_directory (htaccess & SSL in question) 

下面是這個帖子

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> 

回答

0

的時間完成htaccess的使用控制面板尤其是需要的cPanel服務器的控制權,並配置了很多東西不同於標準設置。無論如何,你可能需要添加一個rewritebase到你的插件域。內部插件域的.htaccess將rewritebase更改爲您的addon文件夾。

RewriteBase /target_directory 
相關問題