Dynamic Subdomains

OK, I messaged DH, and asked for wildcard DNS to be turned on, and thus in return, they turned it on for me.

I am using this code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.hostbox.us [NC]
RewriteCond %{HTTP_HOST} ^([a-z0-9]+).hostbox.us
RewriteRule (.*) viewFile.php?user=%1 [L,QSA]

to take the subdomain, pass it to the viewFile.php file, so it can read in the actual file, and print it on the page.

The problem I am having is that I am getting Server not found error.

Any help on this would be greatly appreciated!


When did the wildcard entry get added to your domain? It may take a while for DNS to propagate…

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color]. More Dreamhost coupons

about 2 hours ago.

It worked for them they said, but now they are fixing my .htaccess files, so it will work.

I hope it works correct when it is done.


OK, they could only get half of it, so I have modified what was done, to work slightly better.

[quote]RewriteEngine On

Options -MultiViews

#RewriteCond %{REQUEST_URI}!^/sd_
#RewriteCond %{HTTP_HOST}!^www.hostbox.us [NC]
#RewriteCond %{HTTP_HOST} ^([^.]+).hostbox.us
#RewriteRule (.) /sd_%1/$1 [L]
RewriteCond %{HTTP_HOST} !^www.hostbox.us
RewriteCond %{HTTP_HOST} ([^.]+).hostbox.us [NC]
Options +FollowSymlinks
RewriteRule ^http://(.
).hostbox.us$ http://hostbox.us/viewFile.php?user=$1 [L,R][/quote]
That works almost, It takes me to the correct directory, but it doesn’t open viewFile.php, just a tree structure.