Re: Redirect Problem
| From: | Jenni &/or Patrick | Date: | Sat, 19 Aug 2000 21:33:56 +0000 |
| Subject: | Re: Redirect Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12608@lists.php.net to get a copy of this message | ||
You might try:
<?
Header("Location: http://my.new.ip.address/$REQUEST_URI");
?>
As long as all the docs are in the same place :)
Or, if you would like a slightly less taxing procedure, try:
Redirect / http://my.new.ip.address/
Most sensibly in the .htaccess file.
Boths ways will, when a user requests
http://currentserver/pages/100101.html,
redirect users to:http://my.new.ip.address/pages/100101.html
Hope this is of assistance
----- Original Message -----
From: "FCP Wong" <feicipet@plasticscommerce.com>
To: <php-general@lists.php.net>
Sent: Monday, August 21, 2000 1:44 AM
Subject: [PHP] Redirect Problem
>
> Hi,
>
> I'm in the middle of migrating my website to another server. Due to
problems
> with InterNIC, I can't change the domain name mapping to the IP address in
> time for the migration. So to direct all users who access my domain to the
> new website's IP address, I deleted all files in the old website's web
> directory and put these lines in the default Error Document (which is a
php
> file) :
>
> <?
> header("Location: http://my.new.ip.address/");
> exit;
> ?>
>
> Now anybody who accesses my domain
> http://www.mydomain.com/watever will be
> redirected to http://my.new.ip.address
>
> This is better than nothing, but the problem is everybody who accesses
> direct URL's in my website eg
> http://www.mydomain.com/mydir/myfile.html
will
> get redirected to the site's main index page instead of
> http://my.new.ip.address/mydir/myfile.html. Is there anyway to
> use PHP or
> whatever other ways and means to solve this problem?
>
> I'm open to any ideas...
>
> Thanks a lot
> Wong
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>