Visin
Visin

Reputation: 129

RewriteURL Question - PHP

I have this setup right now...

RewriteRule ^/?user userpanel.php
RewriteRule ^/?user/?newListing newListing.php

The above works for only /user goes to userpanel.php like it should but when I try to access /user/newListing it still takes me to userpanel.php, is there something I am missing with that?

Thank you so much ahead of time!

Upvotes: 3

Views: 63

Answers (3)

John
John

Reputation: 10146

Try using a dollar sign at the end of the first rule? That would make sure the url must end with user

RewriteRule ^/?user$ userpanel.php

Upvotes: 0

Jess
Jess

Reputation: 8700

The expressions are run in order, and because /user/newListing is still valid by ^/?user it goes to the ucp. try making the first rule a little more strict, something like ^/?user/?$ now nothing can follow it.

Upvotes: 0

Francis Gilbert
Francis Gilbert

Reputation: 3442

Switch the order of these and you should be ok.

Upvotes: 1

Related Questions