Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi sennomo,

    Adding the following to your .htaccess file will force non-www over www. Add this just after the line RewriteEngine On:

    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule (.*) https://www.yourdomain.com/$1 [R=301,L]

    Hope this helps!

    Thread Starter sennomo

    (@sennomo)

    Thanks ChristiNi,
    I’ve had very little experience with Apache modules, so I’ve been reading up on the two mentioned here. I also noticed I didn’t have the RewriteEngine On: line in my .htaccess, so I googled that and found I might need to add a couple more lines before that too ??

    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^domain.fi
    RewriteRule (.*) https://www.domain.fi/$1 [R=301,L]

    So, I’m not sure if those other lines were needed, but everything seems to be working now.

    Thanks again ??

    Hi sennomo,

    Glad to hear you got that sorted out. I thought you already had the RewriteEngine On since you had already set up a redirect. Options +FollowSymLinks isn’t always needed explicitly in the .htaccess file. If your redirects work without Options +FollowSymLinks then your server is already setup with those enabled.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Managing redirects with .htpasswd active’ is closed to new replies.