Jump to content

weird rewrite issue


schilly

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.