Jump to content

wildcard subdomains mod_rewrite


Recommended Posts

Hi,

 

I want to give users their own urls e.g. username.site.com for which I need to mod rewrite so

 

username.site.com ::: points to site.com/profile.php?user=username (masked - no redirect)

 

I have accomplished above thing already but I also want to point username.site.com/profile to point to site.com/profile.php?user=username , which I cannot accomplish somehow..

 

Here is what I have::

 

RewriteCond %{HTTP_HOST} !^(www\.)?site\.com [NC] 
RewriteCond %{HTTP_HOST} ^([^.]+)\.site\.com/?$
RewriteRule ^$ /profile.php?user=%1 [L]

 

Please help me.

Link to comment
https://forums.phpfreaks.com/topic/265711-wildcard-subdomains-mod_rewrite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.