Jump to content

Cleaning URLs, excluding certain URLs (login.php)


Go to solution Solved by requinix,

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!

  • Solution

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.