我使用
MVC
创建了一个 php
应用程序,但是当我尝试访问网址时,它给我“服务器遇到内部错误”
当我检查日志时,它给了我:
服务器内部错误
服务器遇到内部错误或配置错误,无法完成您的请求。
请通过 [email protected] 联系服务器管理员,告知他们此错误发生的时间以及您在出现此错误之前执行的操作。
有关此错误的更多信息可能会在服务器错误日志中提供。
我的
.htaccess
文件代码:
Options-MultiViews
RewriteEngine On
RewriteBase/MVC/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
这个问题是由于wampserver使用本地造成的。
您可以通过以下方式更改它:
左键单击 wampsever
转到 APACHE -> APACHE 模块
向下滚动并找到“rewrite_module”
然后标记为勾选
它将自动重新启动。一切就绪。
要启用 mod_rewrite,请执行以下步骤:
1. Find and open the file .http.conf. This will be located in your Apache install folder.
2. Make a backup of http.conf which you can restore from, if anything were to go wrong
3. Find the line #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash ‘#’
4. Locate the block within the directory tags as indicated below and change to:
<directory />
Options All
AllowOverride All
</directory>
5. Find any additional occurrences of the line “AllowOverride None” and change it to “AllowOverride All”.
6.Finally, restart apache server and your browser. The .htaccess rewriting should now be working for any local website.
wampp内部服务器错误解决错误