I am facing issues with two similar friendly urls. I have mentioned the following lines in htaccess.
RewriteRule ^user/([a-zA-Z0-9-]+) /sitename/profile.php?id_profile=$1 [QSA,L]
RewriteRule ^user/([a-zA-Z0-9-]+)/articles /sitename/articles.php?id_profile=$1 [QSA,N]
When I try to access the second url, it redirects back to the first url. I guess the very first part ‘user’ is causing this issue.
Here id_profile is a string. In the php file, i fetch the corresponding user id (integer) for id_profile and perform the rest of the action.
Here is a similar working example.
https://www.etsy.com/people/vinubhai
https://www.etsy.com/people/vinubhai/favorites
I want to make it work like the etsy one. Please do help.
Thanks and Regards,
Vineshkumar Kunhiraman
first rule gets processed first. chang the order of your rules and your problem should be solved.
first the articles rewrite, then the user general rewrite.