MAMP on Mac redirects virtual localhost to https

帅比萌擦擦* 提交于 2019-12-20 05:38:29

问题


Chrome Version : 67.0.3396.87

Webserver : Apache

When I hit http://www.assignmenthelpdesk.local , it redirects to https://www.assignmenthelpdesk.local/

How can I stop MAMP to redirect to https? Thanks in advance.

/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf details below:

<VirtualHost *:80>
    DocumentRoot /Applications/MAMP/htdocs
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /Applications/MAMP/htdocs/AssignmentHelpDesk
    ServerName www.assignmenthelpdesk.local
</VirtualHost>

/etc/hosts details

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
127.0.0.1       www.assignmenthelpdesk.local
255.255.255.255 broadcasthost
::1             localhost

/Applications/MAMP/conf/apache/httpd.conf details below:

# Virtual hosts
Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

回答1:


Everything is working now.

I just had to remove the below two lines from .htaccess for assignmenthelpdesk (local folder)

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]



来源:https://stackoverflow.com/questions/51003617/mamp-on-mac-redirects-virtual-localhost-to-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!