No announcement yet.

WWW or non-WWW

  • Filter
  • Time
  • Show
Clear All
new posts

  • WWW or non-WWW

    By default KVS comes with www-prefixed URLs.
    You should not be concerned about users must type www manually or they won't reach your site - by default all URLs typed without www will automatically redirect to www-URLs.

    If you want to switch URLs to non-www style, please follow this guideline.

    1) In /admin/include/setup.php modify this option and remove www from there:
    2) In /.htaccess file find the following block on top (in some cases it will be missing):

    RewriteCond %{HTTP_HOST} !^www\.(.*)$
    RewriteCond %{REQUEST_URI} !^/admin
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    You should replace it with another code to force all www-URLs be redirected to non-www:

    RewriteCond %{HTTP_HOST} ^www\.(.*)$
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    NOTE: if your project is running under https, you should change http to https in this rule.

    If the above block is missing, just add it after these lines:
    RewriteEngine on
    RewriteBase /
    3) Go to Settings -> Storage Servers in admin panel. For each local storage server remove www part from its URL as well.

    4) Go to Plugins -> Audit and run installation check. You should not have any error indicating incorrect www URL configuration.

    Now you can check your site. URLs should not have www anymore in your design. Also you should try opening any page with www in the URL and make sure browser will redirect you to the same page but without www:
    Code: -> redirected to ->