1

I have my site in sub directory and it works both with and without www prefix but when I place it in maintenance mode I've noticed it doesn't work for the front page without www prefix until you either try log in or go to another linked page.

Is there anyway I can fix it so it works on that front page when no www prefix?

2

Add this to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

(Per this tutorial)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.