简体   繁体   中英

.htaccess not redirecting?

I have the following .htaccess file:

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

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

As you can see by the first line, this:

mydomain.com/s/hello actually shows me the content of the page mydomain.com/servers/page.php?name=hello

and the second line:

mydomain.com/s/hello/new-thread SHOULD show me the contents of the page: mydomain.com/servers/new-thread.php?name=hello ,

but when I type the latter URL, I get the contents of the former page.

This means if I type mydomain.com/s/hello/new-thread , I get shown the contents as if I typed mydomain.com/s/hello . Can someone point out to me why that is? Thank you in advance!

Try this:

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM