Alechko Posted July 20, 2012 Share Posted July 20, 2012 Hi guys, I have a little problem... I wrote this htaccess: RewriteEngine On Options +FollowSymLinks RewriteRule ^(.+)/$ vendor.php?name=$1 [L] RewriteRule ^cart/([\w\-]+)/$ product.php?name=$1 [L] And I got a problem: when I'm trying to enter www.domain.com/HP/ It's working. (By the rule of vendor.php). when I'm trying to enter www.domain.com/cart/product/ - It dosen't working.. It redirects me always to - www.domain.com/cart/product/index.php And I don't want it. I tried to Options -Indexes and more stuff but nothing was useful. many thanks. Link to comment https://forums.phpfreaks.com/topic/265992-redirection-to-indexphp-always/ Share on other sites More sharing options...
requinix Posted July 20, 2012 Share Posted July 20, 2012 The first Rule will also match that second URL you're trying. Stick in an [R] in both Rules to see where you're being redirected to. And switch them around so they're in order of decreasing specificity: the cart/ one first, the catch-all last. Link to comment https://forums.phpfreaks.com/topic/265992-redirection-to-indexphp-always/#findComment-1363127 Share on other sites More sharing options...
Alechko Posted July 22, 2012 Author Share Posted July 22, 2012 man, you are awesome. It worked like a magic. thanks. Link to comment https://forums.phpfreaks.com/topic/265992-redirection-to-indexphp-always/#findComment-1363429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.