What I have currently:

  • A wildcard DNS record. So that every subdomain points to
  • A dynamically (php) generated .htaccess file where I append the following code for every subdomain I want working:

RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^/?$ [R=301]

Everything is working fine, I just want something more if it is possible.

Right now, if someone enters will be redirected to

Is it possible to do this BUT keep to the address bar of the browser?

Was it helpful?


[R=301] means: do a redirection, and since you're using an absolute address it will also force a redirection, i would just change the rules to this:

RewriteCond %{HTTP_HOST} ^$ [OR] 
RewriteCond %{HTTP_HOST} ^$ 
RewriteRule ^/?$ /index.php?user=1 [L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow