virtual subdomain options

Using a single web hosting account to host multiple sites

virtual subdomain options

Postby Stunt » Tue Sep 02, 2008 4:40 pm

hi
i use :

Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]

RewriteRule ^(.*)$ index.php?user=%2 [QSA,L]


and this is work
example :
http://test.domain.com = http://domain.com/index.php?user=test

this is cool . but i want make other rewrite
for example
i want
http://test.domain.com/news-12.html = http://test.domain.com/news.php?id=12

how i can make it ?

so,i use

Code: Select all
RewriteRule ^news-([0-9]*).html news.php?id=$1 [L]


but this is not work
please help me
Stunt
 
Posts: 6
Joined: Fri Aug 22, 2008 1:01 pm

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

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule ^$ index.php?user=%2 [QSA,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule ^news-([0-9]+)\.html$ /news.php?id=$1&user=%2 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Stunt » Fri Sep 05, 2008 11:00 am

wow
thank you
it work
:wink:
Stunt
 
Posts: 6
Joined: Fri Aug 22, 2008 1:01 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 22 guests

cron