Problem - name.domain.com rewrite to domain.com/id

Using a single web hosting account to host multiple sites

Postby webtesterer » Thu Sep 04, 2008 4:25 am

Hi richardk, the rules below work perfectly now,
but when I put a .htaccess file to the subdomain directories, like
Code: Select all
RewriteRule ^index\.html$ index.php [L]

in order to rewrite
Code: Select all
http://tom.example.com/index.html
to
http://www.example.com/2/index.php

making additional rules for the subdomain, they all display my home page -- http://www.example.com

.htaccess is in directory http://www.example.com/2
can this file work or how can I put the additional rule to the rules below ? thank you !

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteMap user_to_id txt:/path/to/map.txt
RewriteRule ^/help(/.*)?$ - [L]

# Fix missing trailing slashes.
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond ${user_to_id:%2} ^([0-9]+)$
RewriteCond %{DOCUMENT_ROOT}/%1%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?example\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.example\.com$ [NC]
RewriteCond ${user_to_id:%2} ^([0-9]+)$
RewriteRule ^(.*)$ /%1/$1 [QSA,L]
webtesterer
 
Posts: 8
Joined: Thu Jul 24, 2008 4:55 pm

Postby richardk » Thu Sep 04, 2008 5:37 am

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteOptions Inherit

RewriteRule ^index\.html$ ./index.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby webtesterer » Fri Sep 12, 2008 5:54 pm

Thank you , You are amazing :D
webtesterer
 
Posts: 8
Joined: Thu Jul 24, 2008 4:55 pm

Previous

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 19 guests

cron