无法从LAN访问Apache服务器

时间:2017-06-26 16:48:48

标签: apache .htaccess server

我已经尝试了一切让它工作但我仍然无法从我的局域网访问我的网站(localhost)。 我正在使用Apache2.4和PHP7.1。 奇怪的是,在我的手机上输入我的计算机IP后,URL从" ip"到" www.ip /"(我有一个.htaccess文件),但给了我错误ERR_NAME_NOT_RESOLVED。我正在使用Chrome。

DirectoryIndex  index.php
RewriteEngine on
RewriteRule ^(\w+)$ index.php?page=$1 [L,NC,QSA]
RewriteRule ^(\w+)+\/$ index.php?page=$1 [L,NC,QSA]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

order allow,deny
deny from 46.101.200.204
allow from all

1 个答案:

答案 0 :(得分:0)

推动" www.ip"在您的客户端上的主机文件中,如果您要通过mod_rewrite坚持该名称。如果您决定停止这样做,您还需要清除浏览器缓存,因为您选择了永久重定向。

相关问题