簡體   English   中英

.htaccess無法重定向?

[英].htaccess not redirecting?

我有以下.htaccess文件:

RewriteRule ^s/([a-zA-Z]+) /servers/page.php?name=$1

RewriteRule ^s/([a-zA-Z]+)/new-thread /servers/new-thread.php?name=$1

如第一行所示,這是:

mydomain.com/s/hello實際上向我顯示了頁面的內容mydomain.com/servers/page.php?name=hello

第二行:

mydomain.com/s/hello/new-thread 應該向我顯示頁面內容: mydomain.com/servers/new-thread.php?name=hello

但是當我輸入后一個URL時,我得到了前一頁的內容。

這意味着,如果我鍵入mydomain.com/s/hello/new-thread ,則會顯示內容,就像我鍵入mydomain.com/s/hello 有人可以指出為什么嗎? 先感謝您!

嘗試這個:

RewriteRule ^s/([a-zA-Z]+)/new-thread /servers/new-thread.php?name=$1 [L]
RewriteRule ^s/([a-zA-Z]+) /servers/page.php?name=$1 [L]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM