ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Redirect without www to www

January 27, 2014 3:48am

Subscribe [4]
  • #1 / Jan 27, 2014 3:48am

    tuninfoforyou

    1 posts

    Hello
    I am a referenceur and I try to redirect my website without www to www {'site.com' to 'www.site.com'} but I don’t know how .
    My site is developed with codegneiter can you help me.

    Please can somebody help me

  • #2 / Jan 29, 2014 4:35am

    growers

    1 posts

    if your server is apache create .htaccess

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

  • #3 / Jan 29, 2014 3:40pm

    CroNiX's avatar

    CroNiX

    4713 posts

    @growers, he wanted non-www to go to www.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> [R=301,L]
  • #4 / Feb 17, 2014 2:49am

    niharika

    1 posts

    Try using htc access file which is useful for redirecting your web pages to page of your choice without any problem.

  • #5 / Aug 07, 2014 11:34pm

    dalirnet's avatar

    dalirnet

    17 posts

    @growers, he wanted non-www to go to www.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) <a href="http://www.domain.com/$1">http://www.domain.com/$1</a> [R=301,L]

    this very good 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases