Force app to use www only

Adam Meyer wrote:

Hi everyone,

I want to go live with my application. But something is wrong with my site when using www.domain.com or domain.com. It seems that it use different instances of the app and create different sessions.

How can I configure my app to redirect to www.domain.com when someone calls domain.com?

Thanks in advance

Adam

Hi,      In .htaccess you specify the rewrite url rule to redirect domain.com to www.domain.com      Place below code in .htaccess

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

Thanks, Priyanka Pathak

Priyanka Pathak wrote:

Adam Meyer wrote:

Hi everyone,

I want to go live with my application. But something is wrong with my site when using www.domain.com or domain.com. It seems that it use different instances of the app and create different sessions.

How can I configure my app to redirect to www.domain.com when someone calls domain.com?

Thanks in advance

Adam

Hi,      In .htaccess you specify the rewrite url rule to redirect domain.com to www.domain.com      Place below code in .htaccess

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

Thanks, Priyanka Pathak

Thanks, I realized it with a .htaccess. The vhost configuration sent me in a loop.

Cheers