How to keep the domain??

Using a single web hosting account to host multiple sites

How to keep the domain??

Postby dvdsero » Wed Dec 10, 2008 9:07 am

Can I do the below and how?

I have a site located at one server (let’s say it has the domain name: domain.com). I have another domain name (let’s say it has the domain name: domain.co.uk) hosted at another server.

I would like traffic to domain.co.uk to be redirected to domain.com but the browser must still says domain.co.uk. When you when click at a link at domain.com and it would now normally say domain.com/xyz.html the browser should say domain.co.uk/xyz.html
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Postby richardk » Thu Dec 11, 2008 7:49 am

The best way to do it is to change the DNS and configure the second server to treat both domains the same. Is there a reason you can not do this?

The other option is to proxy all the requests, for this you need mod_proxy enabled on the domain.co.uk server. This is not an ideal solution as requests to domain.co.uk will use both servers bandwidth/transfer.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby dvdsero » Thu Dec 11, 2008 7:56 am

[quote="richardk"]The best way to do it is to change the DNS and configure the second server to treat both domains the same. Is there a reason you can not do this?
[quote]

Yes - I don't have the opportunity to do thos (affiliate program)
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Postby dvdsero » Thu Dec 11, 2008 7:59 am

What should I do for using mod_proxy??

How can I see if it is enabled??
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Postby richardk » Thu Dec 11, 2008 8:30 am

Try the following in a .htaccess file in example.co.uk's document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule .* http://www.example.com%{REQUEST_URI} [P,L]

If you go to example.co.uk you should be proxied to example.com (if mod_rewrite and mod_proxy are working).
If you are not, replace the P flag with R and see if you are redirected. If you are, that means mod_proxy is not working. If you are not that means mod_rewrite is not working.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby dvdsero » Sat Dec 13, 2008 6:20 am

Hi

is possible to make some exceptions to the above so some urls are handled normal when clicked at them??
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Postby richardk » Sat Dec 13, 2008 9:11 am

Add conditions above the rule.

To ignore files, use
Code: Select all
# Ignore /fileA and /fileB
RewriteCond %{REQUEST_URI} !^/(fileA|fileB)$ [NC]


To ignore directories, use
Code: Select all
# Ignore /directoryA and /directoryB
RewriteCond %{REQUEST_URI} !^/(directoryA|directoryB)(/.*)?$ [NC]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby dvdsero » Sat Dec 13, 2008 9:29 am

The sites in question are:

The original: dvdserotica.eu

The one who are redirected: dvdserotica.com

The problem is that when pressing Add to cart - it does not get in the cart but writes:

There are no items in your shopping cart

To add items to your shopping cart,
click on the "buy now" and / or "add to cart" buttons.


What might be the problem? Any idea about how to solve it? should I use the ignore files or??
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Postby richardk » Sat Dec 13, 2008 10:02 am

The problem seems to be that the session cookies are being set for the .eu domain and not the .com domain.

To fix this i think you need to use only mod_proxy but this requires access to the httpd.conf file.
Code: Select all
ProxyRequests Off

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass                    / http://example.eu/
ProxyPassReverse             / http://example.eu/
ProxyPassReverseCookieDomain example.eu example.com
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby dvdsero » Sun Dec 14, 2008 12:22 am

richardk wrote:The problem seems to be that the session cookies are being set for the .eu domain and not the .com domain.

To fix this i think you need to use only mod_proxy but this requires access to the httpd.conf file.
Code: Select all
ProxyRequests Off

<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass                    / http://example.eu/
ProxyPassReverse             / http://example.eu/
ProxyPassReverseCookieDomain example.eu example.com


Just to understand it. How should I make the change? I cannot do it using php.ini right?
dvdsero
 
Posts: 18
Joined: Tue Dec 09, 2008 10:05 pm

Next

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 20 guests

cron