htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Rewrite URL to dynamicuser.domain.com
PostPosted: Jul 4th, '08, 07:12 
Offline

Joined: Jul 4th, '08, 06:54
Posts: 1
Hi

Basically i have it so when users log in it goes to there user profile located at /user/dynamicuser.php and what i want to do is when they type dynamicuser.domain.com it goes to thier profile page. So far i have succeded by using the code

Code:
RewriteEngine On

# Extract the subdomain part of domain.com
RewriteCond %{HTTP_HOST} ^([^\.]+)\.tutorialwave\.com$ [NC]

# Check that the subdomain part is not www and ftp and mail
RewriteCond %1 !^(www|ftp|mail)$ [NC]

# Redirect all requests to a php script passing as argument the subdomain
RewriteRule ^.*$ http://www.tutorialwave.com/profile.php?username=%1 [R,L]


But when it goes to thier profile page the URL still looks like domain.com/user/dynamicuser.php, i want it so that it still shows dynamicuser.domain.com so any ideas would be appreciated!!

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB