Third Level Domain

Using a single web hosting account to host multiple sites

Third Level Domain

Postby scar81 » Thu Apr 03, 2008 5:38 am

On my site writing www.anything.mydomain.it goes correctly to www.mydomain.it (not with the htacces but with * in the panel).

Now I need that a file, for example, www.anything.mydomain.it/photogallery/photo.jpg
goes to
www.mydomain.it/anything/photogallery/photo.jpg

I have written in htaccess
RewriteEngine on
RewriteRule ^http://www.(.*).mydomain.it/photogallery/(.*)$ $1/photogallery/$2 [L]

But it does not work!!
scar81
 
Posts: 3
Joined: Thu Apr 03, 2008 5:29 am

Postby richardk » Thu Apr 03, 2008 3:57 pm

(Sub) domain names are matched with RewriteCond and %{ HTTP_HOST}, try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

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

Postby scar81 » Thu Apr 03, 2008 11:39 pm

Don't work, 500 internal server error.
scar81
 
Posts: 3
Joined: Thu Apr 03, 2008 5:29 am

Postby scar81 » Thu Apr 03, 2008 11:41 pm

WIthout Options +FollowSymLinks work. It's necessary?
scar81
 
Posts: 3
Joined: Thu Apr 03, 2008 5:29 am

Postby richardk » Sat Apr 05, 2008 4:13 pm

Not if it works without it.
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 20 guests

cron