302 redirect, holding the right domain name after redirect

Using a single web hosting account to host multiple sites

302 redirect, holding the right domain name after redirect

Postby deef » Fri Apr 10, 2009 2:02 pm

I have two domains:

mydomain.com
and
my-tempdomain.com
The original site is at http://www.mysite.eu

Now I wish to do a simple 302 redirect like

Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.my-tempdomain.com/$1 [R=302,L]


I have set up a new site for a client and I wish that he can see the site on my-tempdomain.com. This is working.. but the only problem with this is that the http//www.mydomain.com changes in the browser balk to http://www.my-tempdomain.com

This is offcourse not the meaning, becausse it's not looking good for the client. The temporary domain is even a domain with a whole other name.

Is there a way to solve the 302 that in the browserbalk stays http://www.mydomain.com instead off it changes to http://www.my-tempdomain.com ?

Cheers,

deef
deef
 
Posts: 15
Joined: Thu Jun 08, 2006 1:20 pm

Postby richardk » Sat Apr 11, 2009 11:53 am

Where is the mod_rewrite?
What domain is the user visiting to get redirected?
Does mydomain.com go to a different site/hosting account/server than my-tempdomain.com?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby deef » Sun Apr 12, 2009 1:26 am

Where is the mod_rewrite?


Yeah... is it mod_rewrite or not ? It's a simple redirect I think ?
What domain is the user visiting to get redirected?

The user visits mydomain.com and is redirected to a different site my-tempdomain.com. This site is on a different hosting account /server.

So I'm redirecting people from mydomain.com to my-tempdomain.com. This is working with the 302 redirect code that I gave. But in the browser the location is changing. This is not good, it has to stay mydomain.com.


cheers,

deef
[/quote]
deef
 
Posts: 15
Joined: Thu Jun 08, 2006 1:20 pm

Postby richardk » Sun Apr 12, 2009 12:38 pm

Where is the mod_rewrite?

Yeah... is it mod_rewrite or not ? It's a simple redirect I think ?

I meant, where are you putting that mod_rewrite? In a .htaccess file? Where is the .htaccess file? In a <VirtualHost>? What domain(s) is the <VirtualHost> for? Etc.

What domain is the user visiting to get redirected?

The user visits mydomain.com and is redirected to a different site my-tempdomain.com. This site is on a different hosting account /server.

So I'm redirecting people from mydomain.com to my-tempdomain.com. This is working with the 302 redirect code that I gave. But in the browser the location is changing. This is not good, it has to stay mydomain.com.

The only solution would be to proxy the request. This would require that the mydomain.com server had mod_proxy available. Proxying will use both server's bandwidth/transfer. You would replace R=302 with P.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 15 guests

cron