1.在wordpress的代码目录中增加.htaccess文件(windows下无法直接生成没有名字的文件,不过可以另辟蹊径,随便在哪里新个文本,或者在UE中新建个文档,然后保存到wordpress的代码目录中,名字写上.htaccess,这样就可以创建想要的.htaccess文件了。
2.在.htaccess文件中加入如下内容:
DirectoryIndex index.php index.html
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
3.在apache的配置文件httpd.conf中:
<Directory "C:/Program Files/Apache SoftwareFoundation/Apache2.2/cgi-bin">
</Directory>
AllowOverride None 修改为:AllowOverride All
4.restart apache
5.开个新的IE(要开新的),输入http://localhost/index.php测试。
6.到这里我测试成功,可以使用博客了。