On the website test.com (e.g.) we have htaccess which is working in weird way. Can someone please solve below query:

RewriteRule ^adminportal/(.*)$  adminportal/$1 [QSA,L]

To redirect any visit to http://www.test.com/adminportal/ - to be served by /adminportal folder and it serves well.

Now in the very next line:

RewriteRule ^partnerApi/(.*)$  partnerApi/$1 [QSA,L]

Now this line works for any subfolder within folder partnerApi but does not work for any file which is in partnerApi folder. e.g. http://www.test.com/partnerApi/check.php - does not work but http://www.test.com/partnerApi/checkthis/check.php works...

I am pulling my hairs on why so strange behaviour - can anyone point me to right answer or direction please...

link|improve this question
2  
What is the point of having these rules? As far as I'm aware they are useless because they rewrite URL to the same URL (i.e. doing nothing useful). – LazyOne Sep 8 '11 at 12:02
Thanks for reply but these rules are set to allow access to subfolders e.g. adminportal. By Default users are not allowed to access those folders unless they are in rules and front of the site is served by one of the subfolder. e.g. test.com/viewcart will be served by folder /shop/viewcart.php and similar for rest of pages. So if "adminportal" rule is not specified server will straight look into "shop" folder for that "adminportal" folder – user769889 Sep 8 '11 at 13:42
1  
So your using the [L] flag to stop the processing? There are better ways to handle that. What are the rest of your rules? Rewrite Logs will help you see exactly whats happening. – matthew Sep 9 '11 at 3:52
feedback

migrated from stackoverflow.com Sep 9 '11 at 3:18

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown