Ho I Can rewrite this request types:
http://name1.domain1.com/ -> index.php?subdomain=name1
http://name2.domain2.org/ -> index.php?subdomain=name2
I need manage subdomain GET variable in php script ( index.php ). I need of generic rule for all domain.
This is my .htaccess file, but it's not working.
RewriteEngine On
# Parse the subdomain as a variable we can access in PHP, and
# run the main index.php script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^([^\.]+)\.([^\.]+)\.([^\.]+)$
RewriteRule ^(.*)$ /$1?subdomain=%1
Thanks.