I apologize in advance if I missed someone cover this already; I tried to see if someone had my own .htaccess dilemma:
I currently have the following website: www.example.com
I want to set it up like the following: somewebsite.example.com
And have the subdomain "somewebsite" point to a subfolder on my root. If that subdomain is not available, return them to an error.html in the root folder.
Example:
/
error.html
/img
/websites
/somewebsite
index.html
Here is my .htaccess for the root folder that I am working with:
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^somewebsite\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !somewebsite/ !-d
RewriteRule ^/(.*)$ http://somewebsite.example.com/$1 [L,R=301]
I'm not amazing with RegExp or .htaccess file, but what am I missing to accomplish my goal?