More information about the Underscore mailing list

[_] Any Apache PHP Wizards?

Ben Butterfield Ben.butterfield at propellondon.com
Thu Jan 3 13:19:50 GMT 2008

Not sure about the mod rewrite stuff, but if you have managed to get
foo.com/user/sam to pass the username variable to user.php, couldn't you
just pass the username variable to index.php and then handle
appropriately?

-----Original Message-----
From: Sam Machin [mailto:sam at bs8.org.uk] 
Sent: 03 January 2008 13:16
To: underscore at under-score.org.uk
Subject: [_] Any Apache PHP Wizards?

Hi _

I'm trying to build a site/service and I want to be able to have
usernames ulrs, e.g. http://foo.com/sam

I've worked out how to pass parameters as slashes in the URL eg
foo.com/user/sam where user is a php script but I'd like to do it on
the top level.

Currently I've defined a custom 404 page in .htaccess and I'm using
the $_SERVER['REDIRECT_URL'] variable to get the username.

However I'm rather aware that hacking the 404 isn't really an ideal
solution, anybody know how to do it properly?

FYI I'm running apache1.3 on a MacOSX box and I've got root access.

Rgds
Sam

-- 
underscore_ list info/archive ->
http://www.under-score.org.uk/mailman/listinfo/underscore