[英]Mod rewrite rule only on higher pages?
我的网址看起来像这样:
www.domain.de/de/table.php?id=clubname&page=2
我使用以下规则:RewriteRule ^ footballgames-(。*)/ page([0-9] +)。html $ de / table.php?id = $ 1&page = $ 2 [L]
要获得此信息:www.domain.de/footballgames-clubname/page2.html
一切顺利。
但我不想在第一页上使用它:www.domain.de/footballgames-clubname/page1.html
它应该看起来像这样:www.domain.de/footballgames-clubname.html
可能吗?
尝试以下2条规则:
RewriteEngine On
RewriteBase /
RewriteRule ^footballgames-([^/]+)/?$ de/table.php?id=$1&page=1 [L,QSA]
RewriteRule ^footballgames-([^/]+)/page([2-9]+)\.html$ de/table.php?id=$1&page=$2 [L,QSA]
找不到domain.de/footballgames-clubname.html。 我也对此进行了测试:
RewriteRule ^ footballgames-(。 )/ page([0-9] ).html $ de / table.php?id = $ 1&page = $ 2 [L]
RewriteRule ^ footballgames-(。*)。html $ de / table.php?id = $ 1&page = 1 [L]
URL输入工作正常,但分页的href链接不正确。 如果我使用:
domain.de/footballgames-clubname/page2.html分页链接正确:
domain.de/footballgames-clubname/page1.html
domain.de/footballgames-clubname/page2.html ...
但是,如果我使用:
http://www.domain.de/footballgames-clubname.html分页链接仅显示:
domain.de/page1.html
domain.de/page2.html
这没有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.