我使用MVC
创建了一个php
应用程序,但是当我尝试访问这些网址时,它会给我“服务器遇到内部错误”
当我查看日志时,它给了我:
内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求 请通过admin@example.com与服务器管理员联系,告知他们此错误发生的时间以及您在此错误发生之前执行的操作。
服务器错误日志中可能提供了有关此错误的更多信息。
我的.htaccess
文件代码:
Options-MultiViews
RewriteEngine On
RewriteBase/MVC/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
答案 0 :(得分:2)
这个问题是由于wampserver使用local。
您可以使用以下命令进行更改:
左键单击wampsever
转到APACHE - > APACHE MODULES
向下滚动并找到“rewrite_module”
然后标记检查
它会自动重启。全部设定。
答案 1 :(得分:0)
要启用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.
答案 2 :(得分:0)