Jump to content

.htaccess for subfolders - non-www to www problem


themistral

Recommended Posts

Hi guys,

 

I have a site with htaccess working without problems to redirect non-www to www

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

 

This works for all of the site bar one directory.

 

The directory that doesn't work has a different htaccess file as it uses a different application to the main site.

I have added the same code in but it's not working...

RewriteEngine on
RewriteBase /sub_folder/
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L]

 

I know this is going to be something really stoopid that I have done, so please, any help gratefully appreciated!  ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.