DOMAIN problem@@

Using a single web hosting account to host multiple sites

DOMAIN problem@@

Postby fukid » Sat Dec 02, 2006 7:40 am

i have 3 needs,

1) www.siulok.com remain unchange,
2) weblog.siulok.com ---> siulok.com/weblog
3) XXXXXX.siulok.com ---> siulok.com/photo.php?usr=XXXXXX


Maybe richardk can help me on this,
thanks in advance.
fukid
 
Posts: 7
Joined: Sat Dec 02, 2006 7:35 am

Postby richardk » Sat Dec 02, 2006 3:35 pm

All the sub domains need DNS (possibly Wildcard DNS). All the sub domains must have the same document root as the main domain. Ask you host if they don't.

Then in a .htaccess file in your document root:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^weblog\.domain\.com$ [NC]
RewriteRule !^weblog(/.*)?$ /weblog%{REQUEST_URI} [QSA,L]

RewriteCond %{HTTP_HOST}     !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC]
RewriteRule !^photo\.php$ /photo.php?usr=%1 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby fukid » Sat Dec 02, 2006 6:03 pm

sorry but i have a little bit request more.....

for example, XXXX.domain.com , it works.

but can i only rewrite for http://XXXX.domain.com/ but not
http://XXXX.domain.com/YYYYYY


? thanks in advance.
fukid
 
Posts: 7
Joined: Sat Dec 02, 2006 7:35 am

Postby richardk » Sun Dec 03, 2006 2:17 pm

So what's supposed to happen when you go to XXXX.domain.com/YYYYYY?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby fukid » Sun Dec 03, 2006 3:36 pm

richardk wrote:So what's supposed to happen when you go to XXXX.domain.com/YYYYYY?


remain unchange ,can i ?

thanks
fukid
 
Posts: 7
Joined: Sat Dec 02, 2006 7:35 am

Postby richardk » Sun Dec 03, 2006 4:19 pm

Replace
Code: Select all
!^photo\.php$

with
Code: Select all
^$
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 89 guests

cron