• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
force to www

Hi there! I want to use www in my domain, because of cloudflare reason, as far I know CodeIgniter is using non www as the default. Can someone help me please? Thanks
Hi! I am Jamil

Just edit the .htaccess file in the root where index.php is

Find this in the file:

    # Rewrite "www.example.com -> example.com"
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

Remark out the 3 lines with a # sign:

    # Rewrite "www.example.com -> example.com"
    #RewriteCond %{HTTPS} !=on
    #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    #RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.