1
我最近将我的操作系统从Windows切换到Mac,并且在本地运行时遇到问题。我在/ Applications/MAMP下安装了MAMP。如何在Mac上用MAMP设置F3 .htaccess?
/Applications/MAMP/htdocs/.htaccess文件:
RewriteEngine On
RewriteBase /abc/
# skip all files and directories from rewrite rules below
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule^- [L]
RewriteRule (.+\.(?:gif|png|jpe?g|css|js|woff|ttf))$ /abc/$1 [NC,L]
RewriteRule .* /abc/index.php [L]
这充分的工作在我的Windows环境,但现在只加载一些资源,并引发以下错误:
Not Found (404) - HTTP 404 (GET /index.php)
array(1) {
[0]=>
array(6) {
["file"]=>
string(42) "/Applications/MAMP/htdocs/abc/index.php"
["line"]=>
int(27)
["function"]=>
string(3) "run"
["class"]=>
string(4) "Base"
["type"]=>
string(5) "->"
["args"]=>
array(0) {
}
}
}
我的网络显示它正在尝试GET localhost:8888/abc/index.php,但它正在接收404,即使这是正确的路径。
我相当肯定这是我的.htaccess文件错误,因为我的图像和字体加载正确。
它没有。它存在'Applications \ MAMP \ htdocs \ abc' – jrquick
显示错误的文件是'Applications \ MAMP \ htdocs \ abc \ views \ error.html' – jrquick
应用程序/ MAMP/htdocs/abc/index.php存在 – jrquick