西安做网站_西安网站建设公司_西安网页制作_西安网页设计_西安网站制作设计公司

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 10449|回复: 3

五指cms伪静态

[复制链接]
发表于 2017-5-9 16:53:25 | 显示全部楼层 |阅读模式
一、Apache规则:
<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)\.html$ $1/index.php?v=listing&cid=$2&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/item-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/index.php?v=show&cid=$2&id=$3&page=$3&%1
        RewriteCond %{QUERY_STRING} ^(.*)$
        RewriteRule ^(.*)/show-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/index.php?v=show&cid=$2&id=$3&page=$3&%1
</IfModule>
<VirtualHost *:80>
DocumentRoot D:/www
ServerName localhost
RewriteEngine on
#规则放在下面即可
</VirtualHost>

二、.htaccess 文件
RewriteEngine on
RewriteRule ^item-([0-9]+)-([0-9]+)-([0-9]+).html index.php?v=show&cid=$1&id=$2&page=$3
RewriteRule ^show-([0-9]+)-([0-9]+)-([0-9]+).html index.php?v=show&cid=$1&id=$2&page=$3
RewriteRule ^list-([0-9]+)-([0-9]+).html index.php?v=listing&cid=$1&page=$2
RewriteRule ^tuan/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html index.php?f=tuan&v=init&cid=$1&price=$2&order=$3&page=$4



西安网站建设 | 西安做网站 —— 剑锋所指 所向披靡!
回复

使用道具 举报

 楼主| 发表于 2017-5-9 16:54:47 | 显示全部楼层
Apache规则和.htaccess 文件规则是不一样的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-5-9 16:57:18 | 显示全部楼层
建议把伪静态规则写好一点   最好能够写成  http://localhost/news/(栏目页)   http://localhost/news/id/(文章页)这种类型
回复 支持 反对

使用道具 举报

 楼主| 发表于 2017-5-9 16:57:41 | 显示全部楼层
怎么新建栏目  
默认设置成伪静态
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|西安网站建设

GMT+8, 2024-3-29 01:23 , Processed in 0.042560 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表