domain.nl -> dso.domain.nl

Using a single web hosting account to host multiple sites

domain.nl -> dso.domain.nl

Postby -weenie- » Tue Dec 12, 2006 1:07 am

i'm trying to 'forward' a dso-scooters.nl to dso.meetingclub.nl
but i'de like domaina.nl to stay in url

but domain dso-scooters.nl is registred at another firm, i've forwarded it with the dns a-record(both www and *)

i've managed to do a hard redirect to dso.meetingclub.nl but this is not what i want.

can anyone help me ?:)

greetz
winus
-weenie-
 
Posts: 5
Joined: Tue Dec 12, 2006 12:59 am

Postby richardk » Tue Dec 12, 2006 11:25 am

Set dso-scooters.nl's DNS as a CNAME of dso.meetingclub.nl. (Or just A records so they're exactly the same).

Then the server will need a tiny bit of configuration for it to work. Ask you host if you don't have access to the httpd.conf file. You probably have the ability to add an add on domain.

Mod_rewrite can't really help because the document root needs configuring before you can use mod_rewrite.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby -weenie- » Tue Dec 12, 2006 2:53 pm

yes, i've allready added the second domain to my domainlist, that makes sure the request from dso-scooters.nl end up in my
meetingclub.nl (without www)

from there i can do things with htaccess and mod rewrite,
the rewrite rule i have now, is a hard redirect([R=301]), but i'd like it to be an internal redirect, so the domain dso-scooters.nl stays in the url :)
-weenie-
 
Posts: 5
Joined: Tue Dec 12, 2006 12:59 am

Postby richardk » Tue Dec 12, 2006 3:22 pm

You can't do things with .htaccess files until the domain has a document root on the server (where you'd put it's index.html file). And if you can set that, you should just set it to the right directory. Ask your host.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby -weenie- » Wed Dec 13, 2006 2:43 am

I don't think you understand, dso-scooters.nl has the same document root as meetingclub.nl.

only if i type dso-scooters.nl in the adressbar it should internally go to dso.meetingclub.nl and it is the directory
meetingclub.nl/dso
same like www.meetingclub.nl has the directory
meetingclub.nl/www

now i have this:
#DSO
RewriteCond %{HTTP_HOST} ^dso-scooters.nl$ [NC]
RewriteRule ^(.*)$ http://dso.meetingclub.nl/ [R=301]
RewriteCond %{HTTP_HOST} ^www\.dso-scooters\.nl$ [NC]
RewriteRule ^(.*)$ http://dso.meetingclub.nl/ [R=301]
-weenie-
 
Posts: 5
Joined: Tue Dec 12, 2006 12:59 am

Postby richardk » Wed Dec 13, 2006 5:52 am

dso-scooters.nl has the same document root as meetingclub.nl.

only if i type dso-scooters.nl in the adressbar it should internally go to dso.meetingclub.nl and it is the directory
meetingclub.nl/dso
same like www.meetingclub.nl has the directory
meetingclub.nl/www

That's the information needed.

Mod_rewrite can't rewrite below the document root, you can have /www/dso though, or you could try proxying it:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?dso-scooters.nl$ [NC]
RewriteRule !^dso(/.*)?$ http://dso.meetingclub.nl%{REQUEST_URI} [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby -weenie- » Wed Dec 13, 2006 2:01 pm

richardk wrote:
dso-scooters.nl has the same document root as meetingclub.nl.

only if i type dso-scooters.nl in the adressbar it should internally go to dso.meetingclub.nl and it is the directory
meetingclub.nl/dso
same like www.meetingclub.nl has the directory
meetingclub.nl/www

That's the information needed.

Mod_rewrite can't rewrite below the document root, you can have /www/dso though, or you could try proxying it:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?dso-scooters.nl$ [NC]
RewriteRule !^dso(/.*)?$ http://dso.meetingclub.nl%{REQUEST_URI} [P,L]


for that mod_Proxy must be enabled i think ? that would be a problem because my host hasn't installed it.

Anyway, i will try it tomorrow, can't reach the host now, they are being DDossed :(

thanks for the info :)

greetz, winus

edit : maybe a little addition: my host uses virtualdocumentroot, this makes sure all the request first come to meetingclub.nl
But i can turn it to Documentroot, then all the request go to www.meetingclub.nl or the directory
/home/meetingclub.nl/www

but i think the settings are good now ? because you said that modrewrite can't rewrite below the document root, the full adress on the host for the dso.meetingclub.nl would be
/home/meetingclub.nl/dso

thanks in advance :)
-weenie-
 
Posts: 5
Joined: Tue Dec 12, 2006 12:59 am

Postby richardk » Wed Dec 13, 2006 2:29 pm

Yeah, the mod_rewrite requires mod_proxy.

But i can turn it to Documentroot

Then why can't you edit the configuration and use a <VirtualHost> instead of mod_rewrite?
Code: Select all
<VirtualHost *>
  ServerName   meetingclub.nl
  ServerAlias  www.meetingclub.nl
  DocumentRoot /home/meetingclub.nl/dso
</VirtualHost>

You really should just ask your host, they'll be able to set it up.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby -weenie- » Wed Dec 13, 2006 2:56 pm

i can't have access to httpd.conf :(

but i found a post on the board from my host,
he states in his post on that board, that i should enable document root, so every request goes to the main www directory.
i'm not sure if this is what i want, they talk about "masked rewrites" or something...
still can't test because of de Ddos attack on my host :(

Code: Select all
RewriteEngine On

# Domeinnaam voorzien van www.
RewriteCond %{HTTP_HOST} ^domein1\.nl [NC]
RewriteRule ^(.*)$ http://www.domein1.nl/ [R=301,L]

RewriteCond %{HTTP_HOST} ^domein2\.nl [NC]
RewriteRule ^(.*)$ http://www.domein2.nl/ [R=301,L]

# Indien www.domein1.nl, de website laten zien
RewriteCond %{HTTP_HOST} ^www\.domein1\.nl$
RewriteRule www/(.*) /subdomeinen/www/$1 [l]

# Indien www.domein2.nl, de website laten zien
RewriteCond %{HTTP_HOST} ^www\.domein2\.nl$
RewriteRule www/(.*) /subdomeinen/www/$1 [l]

# Indien het subdomein een bestaande directory is, deze directory laden
RewriteCond %{HTTP_HOST} ^(.*)\.domein1\.nl [nc, or]
RewriteCond %{HTTP_HOST} ^(.*)\.domein2\.nl [nc]
RewriteCond /home/domein1.nl/www/subdomeinen/%1 -l [or]
RewriteCond /home/domein1.nl/www/subdomeinen/%1 -d
RewriteRule www/(.*) /subdomeinen/%1/$1

# Alle andere subdomeinen herschrijven
RewriteCond %{HTTP_HOST} ^(.*)\.domein1\.nl [nc, or]
RewriteCond %{HTTP_HOST} ^(.*)\.domein2\.nl [nc]
RewriteCond /home/domein1.nl/www/subdomeinen/%1 !-l [or]
RewriteCond /home/domein2.nl/www/subdomeinen/%1 !-d
RewriteRule www/([a-z]+)?/?([0-9]+)?/? /profiel/index.php?subdomein=%1&pagina=$1&item=$2
-weenie-
 
Posts: 5
Joined: Tue Dec 12, 2006 12:59 am

Postby richardk » Thu Dec 14, 2006 9:58 am

So change the document root to /home/meetingclub.nl.

/home/meetingclub.nl/.htaccess
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?meetingclub\.nl$ [NC]
RewriteRule !^www(/.*)?$ /www%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTP_HOST} ^(www\.)?(dso\.meetingclub|dso-scooters)\.nl$ [NC]
RewriteRule !^dso(/.*)?$ /dso%{REQUEST_URI} [QSA,L]


You really should just ask your host, they'll be able to set it up.
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 37 guests

cron