
April 27th, 2008, 11:39 PM
|
 |
Contributing User
|
|
Join Date: Jan 2008
Posts: 147
  
Time spent in forums: 1 Day 17 h 34 m 28 sec
Reputation Power: 3
|
|
How to rewrite to http://subdomain.domain/$post/ ?
Hey there how can i rewrite this here http://domain.com/user/$username.php?post=$1
to
http://$username.domain.com/$post/
- Wild card dns is on
- Mod rewrite is on
I also have this working successfully just to let you know:
PHP Code:
RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([^.]+).domain.com$ [NC]
RewriteRule ^$ /user/%2.php [QSA,nc]
as This rewrites:
http://domain.com/user/$username.php
to
http://$username.domain.com
Thanks heaps in advance
Ricky
|