最近闲来无事,老板说要升级公司网站,因而毫无疑问的拿起wordpressphp
其实都很简单,简单记录一下wordpress的伪静态html
第一步 修改apache 的配置文件http.confweb
1 开启apache 重写模块 apache
LoadModule rewrite_module modules/mod_rewrite.so去掉前面 #ide
2 设置 AllowOverride none wordpress
为 AllowOverride all post
重启apache 网站
第二步 在web 目录下创建 .htaccess文件,内容以下 :spa
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPresshtm
在wordpress的管理界面,点击设置-》固定连接,输入内容 /%post_id%.html 如图:
点击保存