2013-05-04 97 views
0

前段時間我設法找到一種方法來將所有的https重定向到http(而不是Apache)。 我想這樣做,因爲我沒有任何SSL證書,但所有瀏覽器都使用force https,因此導致SSL錯誤或超時,具體取決於我是否聽到443的端口。 但是因爲我很笨,所以忘記保存包含該解決方案的Apache的虛擬主機文件,我無法再重新開始工作。重定向https到http ISPConfig&Apache

我嘗試了一切在互聯網上,但沒有奏效。

如果這改變了什麼,我使用ISPConfig與Apache。

我試圖把.htacess中的重寫規則,並沒有發生任何事情。 在apache的default-ssl.vhost中嘗試了這些相同的規則,但沒有再發生任何事情。

這讓我很生氣。 這是我試過的規則,似乎只適用於除我以外的所有人。

RewriteEngine On 
RewriteCond %{HTTPS} on 
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} 

我可能不會把這個在正確的地方,因爲我不知道很多關於Apache和服務器的配置,但因爲我試圖把它無處不在,如果我錯過了點,我會該死。

有人可以指示我在哪裏放置這些規則,或者幫助我在哭泣之前找到解決重定向問題的解決方案嗎?

回答

0

浪費上idotic問題我整個晚上之後,我終於發現,因爲Zend公司把自舉和訪問文件根/ public目錄,我不得不添加

<Directory "/var/www/<link to site made by ISPConfig>/web/public"> 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
      RewriteEngine On 
      RewriteCond %{HTTPS} on 
      RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 
    </Directory> 
    <Directory "/var/www/clients/client0/web1/web/public"> 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
      RewriteEngine On 
      RewriteCond %{HTTPS} on 
      RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 
    </Directory> 

而不是

<Directory "/var/www/<link to site made by ISPConfig>/web"> 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
      RewriteEngine On 
      RewriteCond %{HTTPS} on 
      RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 
    </Directory> 
    <Directory "/var/www/clients/client0/web1/web"> 
      AllowOverride All 
      Order allow,deny 
      Allow from all 
      RewriteEngine On 
      RewriteCond %{HTTPS} on 
      RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L] 
    </Directory> 

這是目錄

我希望它會以某種方式幫助別人,或至少幫助自己什麼時候會再忘記的只是一個該死的故事。