Where is my www going?

Discussion in 'Domain Names' started by Elomelo, Mar 1, 2009.

  1. #1
    I am confused! Could please someone help me out?

    I have bought an .info domain. I have hosted this domain in a server I have bought recently. I have added DNS record both with prefix www and without www.

    But when I write in a browser www. mydomain .info then the page of my website comes but I can see the address in the address bar has been automatically changed to http:// mydomain .info !! Why the www disappearing from the address bar?:confused:
    If I write mydomain.info then same result comes.

    Please tell me how I can make the www remain before my domain name in the address bar.
    I want, when the homepage will come, the site address will look like this
    http:// www. mydomain .info NOT http:// mydomain .info

    Thanks in advance.
     
    Elomelo, Mar 1, 2009 IP
  2. michael221

    michael221 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Simply edit the .htaccess file on your web server to include the following code:

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

    After making this change, both http:// mydomain.info and http:// www. mydomain. info will land you at http:// www. mydomain. info.
     
    michael221, Mar 1, 2009 IP
  3. Elomelo

    Elomelo Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3

    Thanks for reply, but sorry to say that your suggestion did not work.
    According to your suggestion, I had edited the .htacess file...but after adding the lines you have given, I found that the site is not accessible at all and after a long time the browser says...The page cannot be displayed.
    This is what my .htaccess file looked after I edited it according to your suggestion.
    ---------------------------------
    # -FrontPage-
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName mydomain.info
    AuthUserFile /home/mydomain/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/mydomain/public_html/_vti_pvt/service.grp


    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress



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


    --------------------------------
    Anything wrong anywhere? Why did not your suggestion work. Please tell me where is the wrong. Thanks again.
     
    Elomelo, Mar 1, 2009 IP
  4. Elomelo

    Elomelo Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    Problem solved! The solution was within WordPress control panel! Anyway, you deserve thanks for giving me hope that this problem was soluble!
     
    Elomelo, Mar 1, 2009 IP
  5. aloksharma

    aloksharma Well-Known Member

    Messages:
    1,058
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Happy to know that its solved.

    Normally when you order a hosting account, they all are already set to work with or without www.

    BTW, a new problem arising is that now search engine treat www as a subdomain. Not sure how many people know this but I read it at some place. I will recall it and try to put post it here.
     
    aloksharma, Mar 1, 2009 IP