[英]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.