先查看一下你的phpinfo(),如果在apache2handler的Loaded Modules 中找到了mod_rewrite 那么说明你的rewrite module已经加载了。如果没有开启“mod_rewrite”,则打开您的apache安装目录“/apache/conf/”下的 httpd.conf 文件,通过Ctrl+F查找到“LoadModule rewrite_module”,将前面的”#”号删除即可。如果没有查找到,则到“LoadModule”区域,在最后一行加入“LoadModule rewrite_module modules/mod_rewrite.so”(必选独占一行),然后重启apache服务器即可。
全部设定妥当后,我又进行了一次尝试,咦,为什么WordPress中设置的永久链接还是无效呢?问题在这里:
<Directory “E:/www”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files. # It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
看到我加粗的那行了吧,AllowOverride指令,决定了你的.htaccess是否生效,如果你在调试永久链接的时候发现不起作用,不一定只是因为mod_rewrite没有加载,还有可能是httpd.conf设置不对造成的哦~~



Posted in
Tags:

