domain.com/index.php?sub=var to var.domain.com

Using a single web hosting account to host multiple sites

domain.com/index.php?sub=var to var.domain.com

Postby n00b » Sat Apr 26, 2008 7:43 pm

Hi,

I urgently need help with this one. I'm not sure if this is possible only with mod_rewrite but I somehow want to use a php variable as a virtual subdomain.

Ex.
variable.domain.com will be read as
www.domain.com/index.php?subdomain=variable

I am completely new to this so any help would mean a lot. Thanks.
n00b
 
Posts: 3
Joined: Sat Apr 26, 2008 7:32 pm

Postby richardk » Tue Apr 29, 2008 9:41 am

See: Virtual sub domains. Have a go and if you have any problems post back here.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby n00b » Thu May 01, 2008 9:47 pm

hi i have a problem..

i want to redirect multiple variables. i want to redirect..

variable1.domain.com/variable2 to
www.domain.com/subfolder/index.php?var1 ... =variable2

this is what i currently have in .htaccess

Code: Select all
Options +FollowSymLinks +Indexes

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]

RewriteCond %{HTTP_HOST} !^(www|my)\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9]+)\.domain\.com$ [NC]
RewriteRule ^$ /subfolder/index.php?var1=%2 [NC,L]


its redirecting to the subfolder, but all folders under subfolder are missing (css folders, images folders, etc)
n00b
 
Posts: 3
Joined: Sat Apr 26, 2008 7:32 pm

Postby n00b » Fri May 02, 2008 2:55 am

by the way, i'm using typo3. everything is working fine but the folders are not being loaded.

for example

www.domain.com/folder1/subfolder/css and
www.domain.com/folder1/subfolder/images

are not loaded
n00b
 
Posts: 3
Joined: Sat Apr 26, 2008 7:32 pm

Postby richardk » Sat May 03, 2008 4:10 pm

What's the path in the source of the pages to them?
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 21 guests

cron