Code: Select all
RewriteEngine On
# THESE lines don't work???
#RewriteCond %{HTTP_HOST} ^www.cliquedevel.com [nc]
#RewriteRule ^(.*)$ http://cliquedevel.com/$1 [r=301,nc]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]Will be common place. However I would still like to redirect (301?) an empty sub-domain to 'www' by default.subdomain1.domain.com
subdomain2.domain.com
Basically only when there is no sub-domain should the .htaccess redirect (permenently or temp?) to http://www.domain.com
Can someone show me what I would add to the above .htaccess and explain how it works? I have searched Google and found articles but all of them do this redirect in PHP and I would prefer to have this done in .htaccess
Cheers,
Alex