RE: Dynamic sub directory listing without redirect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi List,

I am trying to allow dynamic URL's for my users to remember
similiar to:

www.mysite.com/joesoap

So I want to use "joesoap" in a PHP script to pick up the
user's details
from a MySQL database. If the "joesoap" does not exist in the table
I will handle that.

So basically I have one file www.mysite.com/index.php which should do
all the processing.

I have tried with the apache .htaccess mod_rewrite, however
when I echo
$_SERVER['PHP_SELF'] I can't detect the "joesoap". It returns
/index.php.

Of course the easiest way is to do something like
www.mysite.com/index.php?username=joesoap
but that is too long and complicated for our users. As we
have thousands
of users, I don't want to create actual directories.

Furthermore can this be done too (without a joesoap file):
www.mysite.com/joesoap?show_extra_details=yes

Any advice/links would be much appreciated. If I am barking
up the wrong
tree throw me a bone please.

Thanks alot
Terence

Hi Terence,

I would handle this in a custom 404 error script.  Essentially, just have
the 404 page parse out the "joesoap", check the database to see if its
valid, and act accordingly.

The only drawback to this is that the request won't appear in the access log. At least under apache it won't.

Now if that matter to you or not is another issue...

-philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux