求助apache转换lighttpd伪静态规则
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)goods-([0-9]+).html$ $1goods.php?iid=$2
RewriteRule ^(.*)list-([0-9]+).html$ $1list.php?catid=$2
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+).html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&page=$6
RewriteRule ^(.*)list-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.+)-([0-9]+).html$ $1list.php?catid=$2&sortnum=$3&sp=$4&ep=$5&sq=$6&page=$7
RewriteRule ^(.*)list-(.+)-([0-9]+).html$ $1list.php?sq=$2&catid=$3 [L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正则表达式
引用来自#2楼“鉴客”的帖子
下面一个配置提供参考:
url.rewrite-once = (
"^/rank/([0-9]+).html$" =>"/rank.php?pid=$1",
"^/(w+)/?$" =>"/userinfo.php?puser=$1",
"^/detail/([0-9]+).html$" =>"/detail.php?id=$1"
)
下面一个配置提供参考:
url.rewrite-once = (
"^/rank/([0-9]+).html$" =>"/rank.php?pid=$1",
"^/(w+)/?$" =>"/userinfo.php?puser=$1",
"^/detail/([0-9]+).html$" =>"/detail.php?id=$1"
)