RE: [PHP-DB] rewriting the $server_name variable with php?
| From: | Robert V. Zwink | Date: | Mon, 07 Jan 2002 18:27:03 +0000 |
| Subject: | RE: [PHP-DB] rewriting the $server_name variable with php? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15507@lists.php.net to get a copy of this message | ||
If all of your pages share an include file, then add to the include file
something like this:
<?php
if(strstr($HTTP_HOST, "oldhostname.tld")){
header("Location: http://www.newhostname.tld".$PHP_SELF);
}
?>
That way all requests to the old url will be redirected to the new url. You
can also do something similar with JAVASCRIPT (I see you are using
Dreamweaver, consider modifying a common library item to handle the
redirection using javascript)
Just a thought. Hope it helps.
Robert Zwink
http://www.zwink.net/daid.php
-----Original Message-----
From: Kevin Ruiz [mailto:kruiz@udms.com]
Sent: Monday, January 07, 2002 10:05 AM
To: php-db@lists.php.net
Subject: [PHP-DB] rewriting the $server_name variable with php?
Is there anyway to rewrite the $server_name variable with php? This is kind
of an ambitious post for I think I already know the answer.
My company has just changed our corporate identity and we want our old url
to point to the new one, http://www.worktiviti.com. This
isn't a problem,
we've changed the DNS entries and everything is fine except for the fact
that my boss doesn't want people to see the old url. He wants the url to
reflect the new company name, worktiviti. I've talked to our hosting
company and they said they would look into editing the httpd.conf file but
it doesn't seem likely that they would change the config file for one
customer. I know that you can change the url through the mod_rewrite module
with Apache but I am not that familiar with apache nor do I have access to
the config file. If anyway has any suggestions as to how php could help me
out I'd appreciate it.
Thanks in advance,
Kevin
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net