schilly Posted January 19, 2010 Share Posted January 19, 2010 so i started making a new site based off the code from another. I'm hung up on this rewrite: RewriteRule ^account/(.*) account/index.php?sec=$1 [L] I test it by going to /account/prefs and printing out the _GET array. The _GET array shows this every time instead of "prefs", no matter the variable: Array ( [sec] => index.php ) How index.php is getting set as the sec variable beats me. It doesn't matter what /account/sub_sec_name i use, it always gets set to index.php. This code works fine on my other site so I'm not sure what the deal is. Anyone have any ideas? thx. Link to comment https://forums.phpfreaks.com/topic/188965-weird-rewrite-issue/ Share on other sites More sharing options...
cags Posted January 19, 2010 Share Posted January 19, 2010 .* will match 0 or more characters, since you are not forcing it to traverse to the end of the URL, I'd guess it's simply picking up 0 characters. Try... RewriteRule ^account/(.*)$ account/index.php?sec=$1 [L] Link to comment https://forums.phpfreaks.com/topic/188965-weird-rewrite-issue/#findComment-997931 Share on other sites More sharing options...
schilly Posted January 19, 2010 Author Share Posted January 19, 2010 ok well i figured it out. i left this piece of code out from htaccess which is from my coworker because of the comment on it: #-- No idea what this does RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUEST_FILENAME} -d [NC] RewriteRule .* - [L] Can anyone explain what this does? After I added this code back in, everything worked. Link to comment https://forums.phpfreaks.com/topic/188965-weird-rewrite-issue/#findComment-998190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.