Lukeidiot Posted January 17, 2014 Share Posted January 17, 2014 Hello, I am using lighttpd as my webserver and all ".htaccess" has to be written in the lighttpd.conf Basically I am using regex to clean my URLs. "^/sc5/([^.?]*)$" => "/sc5/index.php?go=$1"The above includes any file into the main index layout. so, example.com/test <- (cleaned) would include test.php into index.php as index.php?go=test <- (uncleaned). My problem is that on my index.php page I redirect anyone without an active SESSION to login.php, but my regex is automatically including it into index.php, and it has a redirect loop. So my question is: How do I exclude (in regex) anything that matches example.com/login.php Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/285457-cleaning-urls-excluding-certain-urls-loginphp/ Share on other sites More sharing options...
Solution requinix Posted January 17, 2014 Solution Share Posted January 17, 2014 Spending a couple minutes checking the documentation, it sounds like you can put that rule in a url.rewrite-if-not-file block. url.rewrite-[repeat-]if-not-file New: For the 1.4.x branch as of 1.4.24 or r2647 from svn: Rewrites a set of URLs internally in the webserver BEFORE they are handled and checks that files do not exist. Quote Link to comment https://forums.phpfreaks.com/topic/285457-cleaning-urls-excluding-certain-urls-loginphp/#findComment-1465613 Share on other sites More sharing options...
Lukeidiot Posted January 17, 2014 Author Share Posted January 17, 2014 Spending a couple minutes checking the documentation, it sounds like you can put that rule in a url.rewrite-if-not-file block. Oh wow, very nice. I was over thinking the situation with a regex implementation. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/285457-cleaning-urls-excluding-certain-urls-loginphp/#findComment-1465614 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.