--- Denzil Kruse <[EMAIL PROTECTED]> wrote:
> My hosting company won't let me use rewrite rules in my Apache
> configuration files, and told me to use "the php header() functions
> and a .htaccess file" instead of the rewrite rules.

[snip]

> What I want to do is have a visitor to my web site enter a userid
> after the domain name, and have apache or php grab the userid and
> send it to a script. Something like this:
>  
> http://domain.name/denny  => 
> http://domain.name/cgi-bin/script.cgi?userid=denny

I don't think you can do this without mod_rewrite, but you can do this:

http://example.org/name/denny =>
http://example.org/cgi-bin/script.cgi?userid=denny

Just make name a PHP script, and use the ForceType directive in your
.htaccess file:

<Files name>
     ForceType application/x-httpd-php
</Files>

In this script (name), you can reference $_SERVER['PATH_INFO'] to get the
rest of the URL. Parse it, redirect the user, or do whatever you want from
there, although it's probably better to just serve the user's request
instead of forwarding to another URL.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

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

Reply via email to