1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.htaccess file is not whowing what to do?

Discussion in 'Search Engine Optimization' started by elabhat, Jun 7, 2017.

  1. #1
    I dont have cpanel access for my static website and there are two versions showing for website.
    I want to redirect that non www on www
    What to do?
    How can to do this with without .htaccess file ?
     
    elabhat, Jun 7, 2017 IP
  2. gatwickjames

    gatwickjames Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #2
    do u have ftp access?
     
    gatwickjames, Jun 7, 2017 IP
  3. elabhat

    elabhat Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Yes I have ftp access
     
    elabhat, Jun 7, 2017 IP
  4. Akjha

    Akjha Member

    Messages:
    59
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    You can redirect all of the requests for yourdomain.com domain to www.yourdomain.com by modifying your website's .htaccess file. Do google and find code as per your need, You can edit the .htaccess file using the File Manager in cPanel or upload .htaccess file in root folder via FTP.
     
    Akjha, Jun 8, 2017 IP
  5. elabhat

    elabhat Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    Yah i did the same.. writen code in note pad and save that by .htaccess but not working
     
    elabhat, Jun 8, 2017 IP
  6. webhost.uk.net

    webhost.uk.net Well-Known Member

    Messages:
    296
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    128
    #6
    whats the code you are using in .htaccess.
     
    webhost.uk.net, Jun 8, 2017 IP
  7. elabhat

    elabhat Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #7

    Below code for without www to www
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^websitedotcom$

    RewriteRule ^(.*)$ httpcolondoublebackslashwwwdowebsitedotcom/$1 [R=301,L]


    Below code to redirect index.html on domain

    RewriteRule ^index\.html$ / [R=301,L]
    RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
     
    elabhat, Jun 8, 2017 IP
  8. elabhat

    elabhat Greenhorn

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #8
    Due to no access for .htaccess file i did following changes -
    I used canonical tag in index.html page
    Ex - 2 pages xyz.com and xyz.com/index.html
    i used <link rel="canonical" href="httpcolondotdubblebackslashwwwdotwebsitedotcom">

    And assign with www domain as preffered domain in google webmaster tool to solve www and without www url problem.
    Is this ok?
     
    elabhat, Jun 9, 2017 IP