I would like to have it setup so that users can have their own sub domain of their choice ie username.domain.com, but still keep certain sub domains for site functions, such as my.domain.com for all of the users account preferences and stuff.
Some examples of links I would like to use are
http://www.domain.com/login/
http://www.domain.com/logout/
http://www.domain.com/join/
http://www.domain.com/browse/
http://www.domain.com/shop/
http://my.domain.com/
http://my.domain.com/profile/
http://my.domain.com/account/
http://username.domain.com/
http://username.domain.com/blog/
http://username.domain.com/gallery/
http://username.domain.com/videos/
So far my .htaccess file looks like this
- Code: Select all
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]
## Regular Site Rewrites
RewriteRule ^login/?$ /login.php
RewriteRule ^logout/?$ /logout.php
RewriteRule ^join/?$ /join.php
## Custom User Sub Domain
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([a-z0-9]+)\.domain\.com$ [NC]
RewriteRule ^$ /view_profile.php?user_url=%2 [NC,L]
My knowledge is intermediate.
If there is anything else that you need to know, I'll be happy to answer.
Thanks