【发布时间】:2016-09-19 15:47:57
【问题描述】:
MAMP 安装在 MacBook 中。我使用 MAMP Apache。
根据网上很多资源,我做了以下工作:
我将
127.0.0.1 my-site.local添加到文件/etc/host。我在
/Applications/MAMP/conf/apache/httpd.conf中取消了Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf的注释。-
在
/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf,我添加了<VirtualHost *:80> DocumentRoot "/Users/myname/laravel/mysite/public" ServerName my-site.local ServerAlias my-site.local <Directory "/Users/myname/laravel/mysite/public"> DirectoryIndex index.php Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Require all granted </Directory> </VirtualHost> -
在
/Users/myname/laravel/mysite/.htaccess文件中:<IfModule mod_rewrite.c> Options +Indexes +FollowSymLinks +MultiViews RewriteEngine On #RewriteBase / # Redirect Trailing Slashes If Not A Folder... #RewriteCond %{REQUEST_FILENAME} !-d #RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] Require all granted </IfModule>
毕竟,localhost、localhost/MAMP、localhost/phpMyAdmin,除了my-site.local,所有工作都可以。
它显示500 Internal server error. The server encountered an internal error or misconfiguration and was unable to complete your request.
【问题讨论】:
标签: apache mamp osx-elcapitan virtual-hosts