domain1.com.au redirect to domain.com + masking

Using a single web hosting account to host multiple sites

domain1.com.au redirect to domain.com + masking

Postby Lexy » Wed Jun 04, 2008 9:57 pm

Great Forum! I have been able to solve half my problem, that is, getting my domain www.mynewestore.com.au to redirect to http://stores.channeladvisor.com/MY-New-EStore
My question: Is it possible now to mask the domain name, so that instead of my visitors seeing in the address bar: http://stores.channeladvisor.com/MY-New ... 20Buggies/
they will see:
http://mynewestore.com.au/RC%20Buggies/ ... 20Buggies/

In essense, I want to mask the domain name, but keep the directory structure.

http://mynewestore.com.au is on WebServer1, i control the DNS and .htaccess file.
http://stores.channeladvisor.com/MY-New-EStore is on WebServer2 - I have no control over it - which is where all the content is.

is this possible?
Tx Lexy
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby richardk » Thu Jun 05, 2008 3:49 pm

You could use mod_proxy (through mod_rewrite) but it will use both server's bandwidth/transfer.
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(.*)$ http://stores.channeladvisor.com/MY-New-EStore/$1 [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Lexy » Thu Jun 05, 2008 5:05 pm

Thanks for the reply Richard. Now I know it's possible at least, and you already answered my next question, how to code it. So thanks again.

I tried the code, it gives me a 404 error. This is the code I had previously:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/stores\.channeladvisor\.com\/MY\-New\-EStore" [R=301,L]

...which only provided me with half the solution- the redirect, but not the masking. What am I missing?

Tx Lexy
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby richardk » Mon Jun 09, 2008 12:37 pm

If you replace P with R do you get redirected (my mod_rewrite)?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Lexy » Mon Jun 09, 2008 4:13 pm

thanks again Richard. :) I replaced the "P"(Proxy?) with "R" (Redirect)

Yes, I get redirected. The URL dislplays as follows:

http://stores.channeladvisor.com/MY-New-EStore

My goal is to display:

http://mynewestore.com.au

Tx Lexy
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby richardk » Wed Jun 11, 2008 2:41 pm

You don't have mod_proxy enabled on the server. Ask your host about enabling it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Lexy » Thu Jun 26, 2008 6:11 pm

Thanks Richard, I'll investigate mod_proxy and report back.
Tx
Lexy
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby Lexy » Sun Jun 29, 2008 5:21 pm

Now I'm more confused than ever. After looking into mod_proxy the apache manual tells me this:
A reverse proxy is activated using the ProxyPass directive or the [P] flag to the RewriteRule directive. It is not necessary to turn ProxyRequests on in order to configure a reverse proxy.

So, if interpret this correctly, I don't need to have mod_proxy turned on in order to use the [P] Flag?
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby Lexy » Sun Jun 29, 2008 8:47 pm

Update so far:

I'm running Apache 1.3.37 with cPanel. My goal is to load mod_proxy, here's what I did:
1. Goto /home/installd/buildapache/apache_1.3.37/src/modules/proxy

2. Run this command:
/usr/local/apache/bin/apxs -i -c *.c
That will install mod_proxy to apache 1.3

3. Edit /usr/local/apache/conf/httpd.conf and add the 3 entries to the appropriate places:

LoadModule proxy_module libexec/mod_proxy.so
AddModule mod_proxy.c
ProxyRequests Off

4. Save and exit the httpd.conf file.

5. Restart apache using the command:
/usr/local/apache/bin/apachectl restart

After testing, it now displays:
http://mynewestore.com.au

but none of the links work now, just get an HTTP 400 error with a URL of
http://mynewestore.com.au/MY-New-EStore ... cessories/

My goal is to display:

http://mynewestore.com.au/Starting%20Accessories/

...any ideas?
Tx Lexy
Lexy
 
Posts: 12
Joined: Wed Jun 04, 2008 9:29 pm
Location: Sydney

Postby richardk » Mon Jun 30, 2008 12:30 pm

The links in the EStore probably contain "/MY-New-EStore". Mod_rewrite can't remove that, but there is mod_proxy_html that can.

Or, you can change the mod_rewrite and leave "/MY-New-EStore" in the URL
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(.*)$ http://stores.channeladvisor.com/$1 [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Next

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 23 guests

cron