简体   繁体   English

V 主机问题 - 无法加载网页 - 继续加载但没有结果

[英]V hosts issue - Couldn't load webpage - Keep loading but no result

I'm trying to set up a local website, using virtual host.我正在尝试使用虚拟主机建立一个本地网站。 I'm working on Mac big sur 11.6 - Mamp 6.3 /apache.我正在使用 Mac big sur 11.6 - Mamp 6.3 /apache。 Bellow is the configuration of the file: /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf下面是文件的配置:/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/Users/THE_USER/sites/symfart/public/"
ServerName  symfart.local
</VirtualHost>

And here is the config of the file /etc/hosts: 127.0.0.1 localhost 255.255.255.255 broadcasthost::1 localhost 127.0.0.1 symfart.local这是文件 /etc/hosts 的配置:127.0.0.1 localhost 255.255.255.255 broadcasthost::1 localhost 127.0.0.1 symfart.local

I already updated the file /Applications/MAMP/conf/apache/httpd.conf and uncommented the 2 lines: LoadModule vhost_alias_module modules/mod_vhost_alias.so And Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf我已经更新了文件 /Applications/MAMP/conf/apache/httpd.conf 并取消注释了两行: LoadModule vhost_alias_module modules/mod_vhost_alias.so 和 Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

NO ERROR > PAGE KEEPS LOADING AND NO RESULT (like an infinite loop) Thanks your help没有错误 > 页面保持加载并且没有结果(就像一个无限循环)谢谢你的帮助

After research I figured out that I was missing a .htaccess file in the Public folder.经过研究,我发现我在公用文件夹中丢失了一个 .htaccess 文件。 This is Its content:这是它的内容:

<IfModule mod_rewrite.c>
RewriteEngine On

# Determine the RewriteBase automatically and set it as environment variable.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]

# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM