HTTPS重定向到http ISPConfig&安培;阿帕奇 [英] Redirecting https to http ISPConfig & Apache

查看:458
本文介绍了HTTPS重定向到http ISPConfig&安培;阿帕奇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前一段时间,我设法找到一种方法,我与Apache所有的https HTTP(而不是相反)重定向。
我想这样做,因为我没有任何的SSL证书,但所有我使用武力HTTPS浏览器,因此导致SSL错误或超时取决于如果我听443的端口或没有。
但是因为我笨,我忘了保存虚拟主机文件的Apache包含解决方案,我不能让它再工作。

some time ago I managed to find a way to redirect all my https to http (and not the opposite) with Apache. I wanted to do that because I don't have any SSL certificate but all the browser I use force https, therefore leading to SSL error, or timeout depending on if I listen to the 443's port or not. But because I'm stupid, I forgot to save the vhost files for Apache containing that solution and I can't make it work again.

我试着在互联网上的一切,但毫无效果。

I tried everything on the internet but nothing worked.

如果改变任何东西,我用ISPConfig与Apache。

If that changes anything, I use ISPConfig with Apache.

我试图把重写规则在.htacess什么都没有发生。
在apache的默认-ssl.vhost尝试这些相同的规则并没有什么又发生了。

I tried putting rewrite rules in the .htacess and nothing happened. Tried these same rules in the default-ssl.vhost of apache and nothing happened again.

它的驾驶我疯了。
这是我试过的规则,似乎每个人都工作,但我。

It's driving me mad. This is the rules I tried and seems to work for everyone but me.

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

我可能不会把这个在正确的地方,因为我不知道很多关于Apache和服务器的配置,但因为我试图把它无处不在,我会该死的,如果我错过的地方。

I may not be putting this at the right place, since I don't know a lot about Apache and server configuration, but since I tried to put it everywhere I'll be damn if I missed the spot.

有人可以请注明我在哪里把这些规则,或者帮助我找到我的重定向问题的解决方案我哭泣过吗?

Can someone please indicate me where to put these rules, or help me find a solution for my redirection problem before I cry ?

推荐答案

浪费上idotic问题我整个晚上之后,我终于找到了,由于Zend公司将自举和访问文件根/ public目录,我刚添加

After wasting my whole night on that idotic problem, I finally found out that since Zend put the boostrap and access files in the root/public directory, I just had to add

<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>

这是目录只是一个该死的故事

It was just a damn story of Directories

我希望它会以某种方式帮助别人,或至少帮助自己的时候,我会再忘了。

I hope that it will somehow help someone or at least help myself when I'll forget again.

这篇关于HTTPS重定向到http ISPConfig&安培;阿帕奇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆