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! Link to comment https://forums.phpfreaks.com/topic/285457-cleaning-urls-excluding-certain-urls-loginphp/ Share on other sites More sharing options...
requinix Posted January 17, 2014 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. 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. 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
Archived
This topic is now archived and is closed to further replies.