本地wampserver如何配置伪静态

今晚本地伪静态的时候出现

Not Found
The requested URL /wordpress/page/3 was not found on this server.


Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80

这样的404错误,由于wordpress放在子目录,在根目录设置htaccess时会出现如下500错误

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.


Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80

一直以为是wordpress的伪静态没配置好,以前也收藏过这个错误的结果方法,原来是没有配置好wampserver。

那么我来分享一下本地wamp实现伪静态:

第一步:找到Apache安装目录下httpd.conf这个文件,搜索找到,“LoadModule rewrite_module modules/mod_rewrite.so”,找到这一行,去掉前面的“#”;

第二步:找到“AllowOverride None”改为“AllowOverride All”.;(测试发现不用修改这一步一样可以)

第三步:重启apache

第四步:新建.haccess文件,在.haccess文件中写伪静态规则,看看。