Is there anyway for me to add some conditions in my root htaccess on my server and have it forward all my sites in subdirectories (add-ons) to their respective www. counterparts? I don't know if there's a way to put a variable in the htaccess file maybe and have it retrieve the sites name itself and add the www (I saw this somewhere on here, but I can't find it and I tried searching). Thanks
What you are trying to do is what an addon domains do with cpanel. So I believe yes it can be done. Do you have cpanel ?
Add-on or parked domains? Either way you can redirect them using mod_rewrite this way Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} yourdomain:com$ [NC] RewriteCond %{REQUEST_URI} !^/www.youdomain.com/.*$ RewriteRule ^(.*)$ /www.yourdomain.com/$1 Code (markup): where /www.yourdomain.com/ means a directory renamed that way, if that is what you meant. Otherwise you migh mean, redirect non-www to www, which is achieved this way Options +FollowSymLinks RewriteEngine On RewriteCond %{http_host} ^yourdomain\.com [nc] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc] Code (markup):
Well, I want to JUST edit the root .htaccess, and leave the ones in the subdirectories along for the add-on domains. HOWEVER, I would like it to the add-on domains will still be forwarded to www. Essentially, I am trying to do as little work as possible...