I have a domain call http://www.example.com.
On this website users come and register with a username and they get a subdomain of their username. So it gets like http://username.example.com.
When they login and go into their admin panel, they can create survey for the users to fill out. At a time they can create multiple surveys and they can give specific folder name to each survey. So like they created a survey and gave it a folder name like http://username.example.com/survey.
I have created a entry in cpanel with * so when we open http://username.example.com, so it goes to index.php and on index.php i have applied condition that if any subdomain is there then we won't show the default index page and will show the survey page, but if we are going for http://username.example.com/survey with a folder name then it is giving me 404.
Now i am rewriting rule in .htaccess to get the folder name but i am getting 404 error?
This is the rule i am having right now.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
</IfModule>
I don't understand what will be the rule to get a folder name. I searched a lot but couldn't get it working.
Can someone please help me or guide me with this?
Thanks for any help.
Ravinder
http://username.example.com/surveyshowing 404? What URL do you want to show./index.php?survey=abcdwhere abcd is survey name