Cloaking http://www.test.com/dir* to http://test2.com:88/*

Using a single web hosting account to host multiple sites

Cloaking http://www.test.com/dir* to http://test2.com:88/*

Postby CruelVenm » Wed Nov 29, 2006 12:12 am

Basically i have a development server running @ port 88 on domain2.com,
but i would like access it from test.com/dir & /dir/* & /dir/dir/* etc to be cloaked from test2.com/* & /dir/* etc etc without the change of address bar location..

Im running Apache 1.3 with mod_rewrite

Ive tried over 100 configurations and they all seem to be backward, for specific files, etc..

Options +FollowSymLinks
Redirect /dir/ http://test2.com:88 [P]

This works, but the test2.com:88 shows up in address bar even with [P] enabled.

Options +FollowSymLinks
RewriteRule /dir/ http://test2.com [P]

Does not work whatsoever and gives me the standard 403 error.

Please help!
CruelVenm
 
Posts: 2
Joined: Tue Nov 28, 2006 11:16 pm
Location: San Diego, CA

Postby richardk » Wed Nov 29, 2006 7:19 am

Redirect isn't mod_rewrite.

test.com/dir & /dir/* & /dir/dir/*

Can you explain that a bit more. /dir/dir/ to the same place as /dir/?

If you have access to the httpd.conf file you should use mod_proxy only.
Code: Select all
<Directory /your/document/root>
  ProxyRequests Off
  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>
  ProxyPass /dir http://newdomain.com:8080
  ProxyPassReverse /dir http://newdomain.com:8080
</Directory>


You will need mod_proxy and mod_rewrite enabled.

In a .htaccess file in test.com's document root:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^dir/dir(/(.*))?$ http://test2.com/$2 [P,L]
RewriteRule ^dir(/(.*))?$ http://test2.com/$2 [P,L]
Last edited by richardk on Wed Nov 29, 2006 2:52 pm, edited 2 times in total.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby CruelVenm » Wed Nov 29, 2006 9:23 am

yes, mod proxy and mod rewrite is enabled.

im sorry, let me clearify a little bit

im trying to mask www.domain.com/dir AS
http://server.com:88

so that when you type in domain.com/dir

every subsequent request * wildcard will be forwarded to server.com:88
yet the address bar shouldnt change.
CruelVenm
 
Posts: 2
Joined: Tue Nov 28, 2006 11:16 pm
Location: San Diego, CA

Postby richardk » Wed Nov 29, 2006 2:21 pm

It shouldn't change. Try it in a .htaccess file in domain.com's document root:
Code: Select all
Options +FollowSymLinks

RewriteEngine On
RewriteRule ^dir(/(.*))?$ http://test2.com:88/$2 [P,L]


Next time keep the fake domain names constant.
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 34 guests

cron