0

Hello, I am developing a site on which upon registration the users will receive a personal site with the address

username.domainname.com

Please tell me how this can be achieved, I think it might b possible with the use of mod_rewrite but I am not sure.

Please help me with this problem.

Thank You

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by architact
0

First .htaccess file:

RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} ^([^.]+)\.domainname\.com$
RewriteRule ^$ /index.php?user=%1 [L]

Second, we must set a redirection from whatever "username.domainname.com" link to "domainname.com". Thats achieved by talking to your hosting provider to setup such a redirect.

Third, according to your site link generation, modify the last line in .htaccess provided lately. In my case it was "index.php?user=1", which was transformed to 1.domainname.com.

0

First .htaccess file:

RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} ^([^.]+)\.domainname\.com$
RewriteRule ^$ /index.php?user=%1 [L]

Second, we must set a redirection from whatever "username.domainname.com" link to "domainname.com". Thats achieved by talking to your hosting provider to setup such a redirect.

Third, according to your site link generation, modify the last line in .htaccess provided lately. In my case it was "index.php?user=1", which was transformed to 1.domainname.com.

Thank You AMD_K8, I will give it a try.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.