301 Redirection for HTML

Discussion in 'HTML & Website Design' started by shashikantseo, Mar 2, 2013.

  1. #1
    Hello Friends ..
    my website opening without www how can i solve it .. i am taking server from goddady .. goddady .htaccess file not accept .. please guide me .. any body can give me code to solve problem ... please tell me steps to solve canonical issue ,... :) thanks
     
    shashikantseo, Mar 2, 2013 IP
  2. Mike In

    Mike In Active Member

    Messages:
    244
    Likes Received:
    5
    Best Answers:
    2
    Trophy Points:
    90
    #2
    Not sure,

    But if the control panel is cPanel then just google it, and you will receive many result how to eleminate or mandatory inc. www before domain.
     
    Mike In, Mar 2, 2013 IP
  3. redpro

    redpro Banned

    Messages:
    226
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #3
    Hi, I am also using goddady server. It's support .htaccess file. If your server is Linux then see below:

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

    If your server is Windows. You have to modify your setting in IIS.

    Hope these will help you.
     
    redpro, Mar 2, 2013 IP
  4. shashikantseo

    shashikantseo Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #4
    thanks Redpro to suggest me --- yes my server is window. after modify setting in IIS. Can i use that code which you gave or i have to use another code for it ..
     
    shashikantseo, Mar 2, 2013 IP
  5. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #5
    The code is for a Linux server. For a Windows server you modify IIS.
     
    Rukbat, Mar 5, 2013 IP
  6. AlbCoder

    AlbCoder Well-Known Member

    Messages:
    126
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    163
    #6
    u can use php with the following code just create a .php file and add

    <?
    Header( "HTTP/1.1 301 Moved Permanently" );
    Header( "Location: http://www.site.com" );
    ?>
    PHP:
     
    AlbCoder, Mar 8, 2013 IP
  7. shashikantseo

    shashikantseo Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #7
    Thanks all -- I got solution -- now creating another website in wordpress
     
    Last edited by a moderator: Feb 25, 2014
    shashikantseo, Feb 24, 2014 IP
  8. Santacruz

    Santacruz Active Member

    Messages:
    673
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    90
    #8
    Actually from wordpress, in the setting you can change the website URL in the general setting. I always do that without touch the htaccess.
     
    Santacruz, Feb 25, 2014 IP