简体   繁体   中英

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. Bellow is the configuration of the file: /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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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