我现在正在设置我的 .htaccess
文件以使用 friendly urls(手动).但是,当我转到 url 时,服务器会显示 Error 404.
I'm setting my .htaccess
file right now to use friendly urls (manually). But, when i go to the url the server shows me Error 404.
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
Rewriterule ^register$ register.php
我很确定 mod_rewrite 已启用,因为我在使用 phpinfo()
时看到了它.
I'm really sure that mod_rewrite is enabled because i see it when use phpinfo()
.
即使 mod-rewrite
已启用,默认情况下 .htaccess
文件并未启用.
Even though mod-rewrite
is enabled, by default it is not enabled for .htaccess
files.
屏住呼吸
Config
按钮,然后选择 httpd.conf
xampp/htdocs">
# AllowOverride All
.去掉#
,这是一个注释AllowOverride All
,确保它在正确的部分,然后删除注释 #
Config
button on the Apache row, and select httpd.conf
xampp/htdocs">
# AllowOverride All
. Remove the #
, which is a commentAllowOverride All
, make sure it is in the right section, and remove the comment #
这篇关于.htaccess 不适用于 xampp(Windows 7)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!