phpcms v9中给Rss伪静态配置方法

作者:袖梨 2022-06-25

ss页面的伪静态实现目标
设置前的URL:http://loc*alho**st/index.php?m=content&c=rss&siteid=1
设置后的URL:http://loca*l*hos*t/rss.html

实现方法:

一、开启rewrite模块

找到Apache 配置文件 httpd.conf

1、LoadModule rewrite_module modules/mod_rewrite.so

把这句的“#”注释掉。

2、AllowOverride none 改为 AllowOverride all

注意,每次改动配置文件httpd.conf后,别忘了重启apache服务器。

二、添加url路由规则

在根目录的.htaccess文件(没有的话自己创建)添加如下代码:

代码如下 复制代码

RewriteRule ^rss.html index.php?m=content&c=rss&siteid=1
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

小结:这是没有分页的phpcms v9伪静态设置,不用在后台的扩展那里添加url规则,相对相对于需要分页的伪静态,要简单得多。在如何实现phpcms v9_4X版本tag的伪静态? 我发现有些网友问题很多,可能我日后会再来一篇phpcms v9伪静态的总结。

相关文章

精彩推荐