Hi friends, I m new to .htaccess and I need ur help in this problem
I want to access http://www.mysite.com/index.php?user=testuser as http://testuser.mysite.com/index.php
(these urls are for informative purpose only.)
I know this can be done using .htaccess readwrite rules.
Whenever a user registers, he should have its own subdomain.
please help me
thanks!
using .htaccess
Moderator: General Moderators
- ganesh_dabhade
- Forum Newbie
- Posts: 19
- Joined: Sun Feb 06, 2011 12:42 am
- Contact:
Re: using .htaccess
If all the subdomains point to the same web root, you may be able to put HTTP_HOST as a get param. Something like this?
That would set user = "testuser.mysite.com"
Not sure if that would work.
Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule ^(.*)$ $1?user=%{HTTP_HOST} [QSA,L]Not sure if that would work.
- ganesh_dabhade
- Forum Newbie
- Posts: 19
- Joined: Sun Feb 06, 2011 12:42 am
- Contact:
Re: using .htaccess
I have used
Please help me solve this.
It worked. But now I am not able to view my index.php file at the root. Instead It shows above page with b is equal to nothing.RewriteEngine On
RewriteRule ^([^/]+) /info.php?b=$1
Please help me solve this.