php - mod_rewrite needed -


Says that I have a domain example.com and I have wildcard DNS turned on. User can register on example.com with username and password. After registration, redirecting username.example.com to example.com/script/script.php?user=username begins. The address bar will still show username.example.com

What will be the contents of the .htaccess file to accomplish this?

I have zero expertise with mod_rewrite. Please advise. Thanks and relation.

Assume that your host is configured to serve all hostnames with the same DocumentRoot , then you want something like this:

  Rewwighting On # IF did not get example example.com and mail www.example.com RewriteCond% {HTTP_HOST}! Example \ .com RewriteCond% {HTTP_HOST}! ^ Www \ .example \ .com #then Regenerate RewriteRule ^ (. *) According to this rule $ Script / script.php? User =% {HTTP_HOST}  

If you are not on a shared hosting and can not specify a debug-log file, you have to test yourself on a test server that you have.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -