[thelist] [PHP, apache] redirect with logic

Michael Pemberton evolt at mpember.net.au
Fri May 21 05:17:56 CDT 2004


Geoff Sheridan wrote:

> Hello
> 
> I'd like people to type in:
> 
> http://mysite/foo/
> 
> The folder 'foo' does not exist.
> Instead, a script would look up user 'foo' in a MySQL database, find the 
> userID was '123' and redirect to
> 
> http://mysite/script.php?$id=123
> 
> I already have the database. How can I configure Apache/PHP to do this 
> redirect? Essentially it's a matter of getting the variable 'foo' into a 
> php script, not a 404 - I can take it from there.
> 
> Geoff

Can you do ir with a redirect instead of a 404 detection?  eg. if all 
user folders start a '~', you could put in an alias that sends the 
client to your required site.

-- 
Michael Pemberton
evolt at mpember.net.au



More information about the thelist mailing list