I have osclass website at openshift free tier.but for openshift only www version of domain is working not root.My site htaccess file have follow content. what i add to .htaccess file so that it automatically redirect user from http;//mydomain.com to www.mydomain.com
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
Add this rule just below RewriteBase /
line:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [NE,R=301,L]