-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Whilst lounging around on Mon, 11 Aug 2003 11:18:29 -0800,
"fartsniff" <fart@sniff.com> amazingly managed to produce the
following with their Etch-A-Sketch:
[color=blue]
> Hello all,
> Been playing around with capturing the entire URL. I dont have any
> problems if it a file,
> i.e.
http://www.mydomain.com/somefile.php, I am running into
> problems with this,
>
http://www.mydomain.com/test
>
> This is what I use for "redirection" now (btw, it is IIS (Win2k)
> and PHP 4.3.2)
> The test.mydomain.com is setup as a host header under IIS
>
> $redirect = getenv("HTTP_HOST");
>
> if ($redirect=="test.mydomain.com"){
> header("Location:http://www.mydomain.com/modules.php?name=test");
> }
>
> The above code works fine. Redirects no problem.
>
> However, I am trying to get this to do the same thing:
>
www.mydomain.com/test or
www.mydomain.com/test/
> and both would take you here:
>
http://www.mydomain.com/modules.php?name=test
>
> I have tried every combination of the SERVER vars, but no luck.
> I either generate a 404 or the test isn't part of the URL.
>
> Any ideas ?
>[/color]
$_SERVER['REQUEST_URI'] should contain the stuff after the
domain.com/ part.
I'm sure you have good reasons.. but to me personally, this looks
like you're attempting to get PHP to do something that is best suited
to the server via mod_rewrite:
RewriteRule ^/(.*)/$ /modules.php?name=$1 [L]
or something similar.
Forgive me if I'm wrong =)
Regards,
Ian
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0
iQA/AwUBPzf6CGfqtj251CDhEQIjggCg/J2Ru64A9bSIGR8pORlXKzAiqMoAoN7r
FAKsAIVkowYNARM9gNR5M55c
=Yoop
-----END PGP SIGNATURE-----
--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.