HaLo2FrEeEk Posted May 18, 2008 Share Posted May 18, 2008 Is there a way to make an htaccess file only work for the directory it's present in? I have one that rewrites some dynamic links to static looking ones, and it messed up some stuff further up the folder heirarchy, though I don't knoe exactly how? I renamed the htaccess file to .test so it wouldn't affect anything, but I would like to have it, so is there any way I can make it only work in the current folder? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/106155-htaccess-problems/ Share on other sites More sharing options...
wildteen88 Posted May 18, 2008 Share Posted May 18, 2008 Post your current code for your rewrites You should look into applying conditions so certain urls do not get applied to your rewrite rules. Also try to not use greedy regex terms eg: (.*) in your rules too Quote Link to comment https://forums.phpfreaks.com/topic/106155-htaccess-problems/#findComment-544143 Share on other sites More sharing options...
HaLo2FrEeEk Posted May 18, 2008 Author Share Posted May 18, 2008 I guess I'm greedy, lol, that might have done it. RewriteEngine on RewriteRule d_(.*)$ index.php?file=$1 RewriteRule (.*)_(.*)_(.*)_(.*).html$ index.php?page=$1&rpp=$2&so=$3&admin=$4 RewriteRule (.*)_(.*)_(.*).html$ index.php?page=$1&rpp=$2&so=$3 RewriteRule (.*).html$ index.php?page=$1 I didn't think it would mess anything up, but it's the naming I'm doing that was messing with it. It was only 5 files that were being affected, out of 35. How would I go about putting conditions in there? Basically I want this to only work for the folder which it is physically located in, and no deeper. Quote Link to comment https://forums.phpfreaks.com/topic/106155-htaccess-problems/#findComment-544170 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.