Reputation: 912
Is it possible to edit a htaccess to always use www in a certain subfolder? I've found the option to do it for whole directories, but I can't find any way of doing it for a sub directory.
Upvotes: 1
Views: 22
Reputation: 785541
You can use this rule in root .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(folder1|folder2)/ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE,NC]
This will only affect folder1
and folder2
for adding www
in domain name.
Upvotes: 2