user569322
user569322

Reputation:

.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!

Upvotes: 0

Views: 77

Answers (1)

Lior Cohen
Lior Cohen

Reputation: 9055

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]

Upvotes: 3

Related Questions