开发者

Disable https on localhost

I need to automatically redirect any https:// to http:// on my localhost environment. I tried to use a .htaccess file which I placed on my htdocs/ with the following code:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteR开发者_开发技巧ule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

For some reason this is not working. Any advice?


The problem with the rewrite rule is that it will never be reached if apache is not configured properly for SSL. The browser is trying to connect to http://localhost:443 and unless apache or some other service is configured on that port you'll get a timeout.

The best solution would be to create a self-signed certificate for apache running on localhost and create a rule in your web browser to trust the certificate:

Create a self-signed certificate for apache:

http://www.perturb.org/display/entry/754/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜