第一步:打开打开Apache—>conf—>httpd.conf文件,或者也可以从上图位置中进入,搜索
#LoadModule rewrite_module modules/mod_rewrite.so 去掉前面的#号
第二步:找到“AllowOverride None”改为“AllowOverride All”.;
第三步:重启apache
第四步:新建.haccess文件,放在当前网站根目录下,在.haccess文件中写伪静态规则,看示例
RewriteEngine on
RewriteBase /
RewriteRule ^article\.html$ /article.php
RewriteRule ^article\_(+)\.html$ /article.php?page=$1
下面给个wordpress伪静态配置规则
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
RewriteRule ^(.*)(xmlrpc)+(.*)$ https://www.111cn.net /100mb.test [NC,R=301,L]
到此就完成了,当然也可以直接在conf文件中加入以上代码是一样的
deepin20怎么新增字体? deepin20安装字体的教程
Linux如何给文件权限? linux给文件添加可执行权限的技巧
deepin20桌面图标样式怎么修改? deepin更换图标主题的技巧
virtualbox打不开虚拟机怎么办? linux无法访问virtualbox的解决办法
deepin怎么注销系统? deepin系统注销与切换用户的方法
Manjaro linux怎么调鼠标速度? Manjaro鼠标设置光标速度的技巧