Results 1 to 13 of 13
Like Tree2Likes
  • 1 Post By willsondany
  • 1 Post By kuchbhi

Best Way To Redirect Without www to www

This is a discussion on Best Way To Redirect Without www to www within the Web & Server Administration forums, part of the Web Designing & Development category; Hey Friends.. Please tell me what is the best way to redirect without www to www....

  1. #1
    Senior Member
    Join Date
    Jul 2012
    Location
    india
    Posts
    269

    Default Best Way To Redirect Without www to www

    Hey Friends..
    Please tell me what is the best way to redirect without www to www.

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Posts
    25

    Default Re: Best Way To Redirect Without www to www

    i think your site open with www and with out www this is good technique to redirect if your site not open with out www this is not good practice

  3. #3
    Senior Member
    Join Date
    May 2013
    Posts
    290

    Default Re: Best Way To Redirect Without www to www

    If you want to redirect all non-www requests to your site to the www version, all you need to do is add the following code to your .htaccess file:

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

  4. #4
    Senior Member
    Join Date
    Apr 2012
    Posts
    519

    Default Re: Best Way To Redirect Without www to www

    Replace example.com with your domain name and upload it to your .htaccess file and upload its over

    //Rewrite to www
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com[nc]
    RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]

    You can use this tool for various redirects http://www.htaccessredirect.net

  5. #5
    Senior Member
    Join Date
    Apr 2013
    Posts
    105

    Default Re: Best Way To Redirect Without www to www

    Redirect urls without www to www

    When it comes to SEO, it is important to make sure that the site with www and without www are both valid if the other has been indexed in the past.

    An easy way to achieve this is via the .htaccess file in the root directory. When you set up your hosting you would have specified the url with or without the www. If you had declared it with the www, you will need to redirect all urls without www to www and vice versa.

    For redirect for urls without www to www, add these lines of code to the start of the .htaccess file.

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

    If your url does not contain the .au or any other extension in the end, you can ignore the last part “\.au” and it would look like this.

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

    If you would like to redirect www to the url without www use the code below:

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

  6. #6
    Member
    Join Date
    Jun 2013
    Posts
    73

    Default Re: Best Way To Redirect Without www to www

    An easy way to achieve this is via the .htaccess file in the root directory. When you set up your hosting you would have specified the url with or without the www If you had declared it with the www, you will need to redirect all urls without www to www

  7. #7
    Senior Member
    Join Date
    Mar 2012
    Posts
    250

    Default Re: Best Way To Redirect Without www to www

    The slightest syntax error in .htaccess(like missing space) causes a big change and your content can't be display correctly at all.This the simplest to redirect your site but it require a keen attention during the redirection.

  8. #8
    Junior Member
    Join Date
    Jun 2013
    Posts
    3

    Default Re: Best Way To Redirect Without www to www

    create .htaccess file and upload this file in root folder of website

  9. #9
    Senior Member vakkor's Avatar
    Join Date
    Mar 2013
    Posts
    105

    Default Re: Best Way To Redirect Without www to www

    add the following code to your .htaccess file:


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

  10. #10
    Senior Member
    Join Date
    Oct 2013
    Posts
    199

    Default Re: Best Way To Redirect Without www to www

    hey frend I agree with willsondany nice openion give.

  11. #11
    Senior Member
    Join Date
    Oct 2013
    Posts
    100

    Default Re: Best Way To Redirect Without www to www

    create .htaccess file and upload this file in root folder of website



  12. #12
    Member
    Join Date
    Feb 2014
    Posts
    64

    Default Re: Best Way To Redirect Without www to www

    I agree with mayur-strad

  13. #13
    Member
    Join Date
    Jul 2014
    Posts
    52

    Default Re: Best Way To Redirect Without www to www

    through htacess file