user8438226
user8438226

Reputation: 1

Force to www not working for subfolder

This is not working with subfolder.

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^mysite.com/wordpress/ [NC] 
RewriteRule ^(.*)$ http://www.exemple.com/wordpress/$1 [L,R=301]

But this is working.

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^mysite.com/ [NC] 
RewriteRule ^(.*)$ http://www.exemple.com/$1 [L,R=301]

Thanks.

Upvotes: 0

Views: 23

Answers (1)

Croises
Croises

Reputation: 18671

You can use:

RewriteEngine on 
Options +FollowSymLinks 
RewriteCond %{HTTP_HOST} ^exemple\.com$ [NC] 
RewriteRule ^wordpress/(.*)$ http://www.exemple.com/wordpress/$1 [NC,L,R=301]

Upvotes: 1

Related Questions