Jump to content

Cleaning URLs, excluding certain URLs (login.php)


Lukeidiot

Recommended Posts

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!

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.

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.

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.