I have written a RewriteRule which works on the basis of HTTP_HOST (www.domainname.com), but I want it to work on the basis of the domain name part only (domainname.com).
To clarify further
The folder structure is /var/www/domainName.com
.
When I write this rule in apache conf file
RewriteRule ^/js/(.*) /%{HTTP_HOST}/js/$1 [L]
and access the site using www.mydomain.com -- it tries to find the folder /var/www/www.domainName.com
, which does not exist.
So, I need to convert the above-mentioned rule to remove the "www" from the HTTP_HOST.