Dynamic Subdomains htaccess

First of all, you need to add wildcard (*) DNS record on your host.

Second, copy following code in your htaccess, after "RewriteEngine On" command, don't forget to change to your domain

RewriteCond %{HTTP_HOST} ^([^.]+).webarto.com$ [NC]
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule %1$ http://www.webarto.com/ [R=301,L]

Note: your real subdomains will not be rewritten.

You can use this to set languages, examples:

http://eng.smchiptuning.com/
http://deu.smchiptuning.com/
http://eng.bsdadvisors.com/
http://deu.smchiptuning.com/

Adding wildcard record to your domain in cPanel:


New record shows up in list, that's it.
©2009-2011 Webarto • web design & development • Tuzla // Sarajevo // Beograd