I'd like to catch all subdomains of my subdomain and redirect them to a PHP script which will process the subdomain. I need this because I'm creating an online tool for a game which saves it's configuration in a cookie, to allow the user several configurations for the same server they could just use variations of a subdomain, eg:
en10.tomcenc.x10hosting.com
server10.tomcenc.x10hosting.com
qsfd10.tomcenc.x10hosting.com
I know the PHP to parse the server from the subdomain but am unable to catch the subdomains using the code I found on the web (to put in my .htaccess file)
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} !^tomcenc\.x10hosting\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.tomcenc\.x10hosting\.com?$
RewriteRule ^$ /server.php [L]
It just gives a "congratulations you installed apache with cpanel" or something like that. For each sub subdomain.
I'll be moving to paid hosting with a real domain before I make it public but I can't get paypal to work (yet). But I suppose I can edit the code myself to work for a subdomain instead of a sub-subdomain.
I'd like the code to get to the right file and query string so it works the same as a real subdomain.
en10.tomcenc.x10hosting.com
server10.tomcenc.x10hosting.com
qsfd10.tomcenc.x10hosting.com
I know the PHP to parse the server from the subdomain but am unable to catch the subdomains using the code I found on the web (to put in my .htaccess file)
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{HTTP_HOST} !^tomcenc\.x10hosting\.com?$
RewriteCond %{HTTP_HOST} ^([^.]+)\.tomcenc\.x10hosting\.com?$
RewriteRule ^$ /server.php [L]
It just gives a "congratulations you installed apache with cpanel" or something like that. For each sub subdomain.
I'll be moving to paid hosting with a real domain before I make it public but I can't get paypal to work (yet). But I suppose I can edit the code myself to work for a subdomain instead of a sub-subdomain.
I'd like the code to get to the right file and query string so it works the same as a real subdomain.
Last edited: