two hosts to one domain.

Using a single web hosting account to host multiple sites

two hosts to one domain.

Postby Peter » Sat Apr 21, 2007 4:11 am

I asked about a way to use many host but only one domian. like www.domain.net is on host and www.domain.net/folder shows the other hosts thing. Some have told me that this can be done with mod rewrite but noone knows how.
Is this possible with mod rewrite? If it is, how can I do that?
Peter
 
Posts: 5
Joined: Tue Mar 20, 2007 12:47 pm

Postby richardk » Mon Apr 23, 2007 10:09 am

It would require mod_rewrite and mod_proxy. In a .htaccess file in the domain.com's document root (on the main host)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^folder/(.*)$ http://www.other-host.com/something/$1 [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Peter » Wed Apr 25, 2007 10:26 am

I don't know what mod_proxy is but I use the code you gave me and it worked very well! :D Is that code mod_proxy also?
Last edited by Peter on Wed Apr 25, 2007 11:19 am, edited 2 times in total.
Peter
 
Posts: 5
Joined: Tue Mar 20, 2007 12:47 pm

Postby richardk » Wed Apr 25, 2007 11:18 am

The P flag in the RewriteRule means that instead of redirecting (which it otherwise would because the path starts with http://) it gets passed to mod_proxy and proxied.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Peter » Wed Apr 25, 2007 11:20 am

I don't know exactly how this work so does this take bandwith from the host that I have www.domain.net on?
Peter
 
Posts: 5
Joined: Tue Mar 20, 2007 12:47 pm

Postby richardk » Wed Apr 25, 2007 11:36 am

The file gets transfered twice. You request it from server A, the request is proxied to server B, the file is sent to server A from server B, server A sends the file to you. Whether it counts towards you bandwidth limit i don't know.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Peter » Wed Apr 25, 2007 11:37 am

Ok thanks.
Peter
 
Posts: 5
Joined: Tue Mar 20, 2007 12:47 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 6 guests

cron