I’m trying to redirect all subdomains at (http://*.domain.com) to spesific html file (http://domain.com/index.html). But I also want to visible subdomain name won’t change.
I’ve tried this one with .htaccess:
Options -MultiViews
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
#RewriteCond %{REQUEST_URI} !^/parent/
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$
RewriteRule (.*) /index.html [L]
But it doesn’t work at all.
Can anyone help me?
Subdomains are a bit different than directories. You need to have a wildcard DNS record to catch all subdomains:
Best thing to do would be to contact your hosting provider. Some of them have settings to achieve that.