[thelist] getting the server to add an '?' on the end of a ur l...

Rob Smith rob.smith at THERMON.com
Thu Nov 14 15:23:01 CST 2002


Hello,

I've done something simiar to what you're going after, but It's not of PHP
nature. You can determine the HTTP host and say something like, if http_host
= 'www.foo.com' then redirect to www.foo.com/bar.ext? However, I'm under the
impression that you should only use the ? mark when you have a string to
attach. I added the ? mark to one of my pages, refreshed, and the page seems
to be unharmed. oh well.

However, I've managed to find a solution for PHP:

if ($HTTP_HOST)
{
   if($HTTP_HOST == www.domain.net || $HTTP_HOST == "domain.net" ||
$HTTP_HOST == "IP address")
   {
       header ("Location:http://www.domain.com");
       exit;
   }
}

HTH!

Rob.Smith

-----Original Message-----
From: Dunstan Orchard [mailto:dunstan at 1976design.com]
Sent: Thursday, November 14, 2002 3:03 PM
To: thelist at lists.evolt.org
Subject: [thelist] getting the server to add an '?' on the end of a
url...


Hi there,

a site I'm building relies on each url having an '?' at the end of it -
preparatory to having variables tacked on the end.

Is there anyway I can do something server side to ensure that if someone
visits:

http://www.foo.com/bar.php

the url is automatically changed to:

http://www.foo.com/bar.php?


I'm on apache if that makes a difference.


thanks very much - dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.orchard.it/
http://www.maccaws.org/
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list