To always redirect users to the www site (for example: http://dotboost.com to http://www.dotboost.com), add the following lines to .htaccess, right after RewriteEngine On:

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


If, on the other hand, you want to redirect http://www.dotboost.com to http://dotboost.com, add the following lines instead:

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

Replace dotboost.com with your site’s domain.


Looking for PHP, Laminas or Mezzio Support?

As part of the Laminas Commercial Vendor Program, Apidemia offers expert technical support and services for:

  • Modernising Legacy Applications
  • Migration from any version of Zend Framework to Laminas
  • Migration from legacy Laminas API Tools (formerly Apigility) to Dotkernel API
  • Mezzio and Laminas Consulting and Technical Audit
  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>