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.

Using .htaccess to improve SEO in a few minutes

Discussion in 'Search Engine Optimization' started by dealeris, Sep 1, 2011.

  1. #1
    .htaccess is a configuration file for use on web servers running Apache software. Usually all public hosting providers use Apache.

    You can take advantage of .htaccess by creating or changing this file in your “public_html” directory.



    Optimizing 404 errors with .htaccess

    Websites tend to lose content or change urls from time to time. Not working urls stays in google cache and when google bot crawls them they receive 404 not found error instead of 200 ok. It is better to avoid giving google and most of all your visitors, broken links.

    For example we recently removed “http://www.cheapseoservices.org/directory-submission-service/” from our website, but google has it listed and people may find it with keywords like: “cheap directory submission service”, so it is more convenient for the visitor if we redirect him to related or current services we are offering.

    We add this line to our .htaccess file:

    and create 404.php file in “public_html”

    404.php:

    This will redirect all our 404 not found pages to homepage, where user will be able to see what we currently offer. Google also sees this as a benefit, because we are making sure visitor is not left alone and he gets at least related information he was looking for.

    Enabling Gzip compression

    Gzip compression is a feature nowadays websites and browsers use to improve website load time. One of google ranking factors is page speed, so if you can, use this method. Most modern hosting providers have mod_gzip module running on their Apache.

    To enable gzip compression add this code to your .htaccess file:

    Forcing www.


    Technically urls “www.website.com” and “website.com” are duplicates and sometimes if you enter website url without “www.” you get an error.
    To avoid errors and inconvenience for the user, choose if you want to use www. or not and add this code to your .htaccess file:

    Creating SEO friendly URLS

    Instead of having urls like: ”www.mywebsite.com/index.php?page=contacts&id=9999″ it is better to use seo friendly urls like: “www.mywebsite.com/contacts/”. SEO friendly urls are more convenient for the user, because he can easily indentify what is the website about, just by looking at the address bar.

    To create SEO friendly urls add this code to your .htaccess files:

    301 permanently moved redirect for moved content

    Sometimes you have to change location of your content. For example "www.cheapseoservices.org/some-topic/" has to be changed to "www.cheapseoservices.org/some-topic-and-additional-features/". To avoid serving your visitors page not found errors, use this kind of code in your .htaccess file:

     
    dealeris, Sep 1, 2011 IP
  2. Barney Stinson

    Barney Stinson Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just know .htaccess can help make 301 redirect and 404 page, never know other functions, eye-opener.
     
    Barney Stinson, Sep 1, 2011 IP
  3. hadinih

    hadinih Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thank you for share this. I think I will try it to my site :)
     
    hadinih, Sep 1, 2011 IP
  4. johnyhorper

    johnyhorper Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks dealeris, you have mentioned an very important aspect of on page seo. having a proper redirection along with 404 not only makes a website useful for an SE but also to a visitors.
    Its a really great share.
     
    johnyhorper, Sep 1, 2011 IP
  5. ysribharath

    ysribharath Well-Known Member

    Messages:
    744
    Likes Received:
    10
    Best Answers:
    1
    Trophy Points:
    155
    #5
    i use wordpress with w3 total cache .. do u need to it again ?
     
    ysribharath, Sep 1, 2011 IP
  6. cro-mag

    cro-mag Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I was looking this days for something similar... now I am glad that I have found exactly what I need. Thank you
     
    cro-mag, Sep 1, 2011 IP
  7. girish sharma

    girish sharma Peon

    Messages:
    236
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here are six htacccess tricks which will help improve the security and Seo quality of your WordPress-powered website
    1. Canonical robots.txt
    2. Canonical Favicons
    3. Canonical Sitemaps
    4. Canonical Category, Tag & Search URLs
    5. Canonical Feeds
    6. Simpler Login URL

    The .htaccess code in this post is designed to work when placed in the web-accessible root .htaccess file of your domain. Before making any changes to this file...
     
    girish sharma, Sep 1, 2011 IP
  8. kittonian

    kittonian Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    To be fair, the www vs. no www situation should really be handled by the DNS configuration via a CNAME. If it's not, you should question your provider's DNS implementation. The rest of the suggestions are excellent. Great post!
     
    kittonian, Sep 1, 2011 IP
  9. jim60723

    jim60723 Member

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #9
    website load time can also be reduced by cache controlling
     
    jim60723, Sep 1, 2011 IP
  10. jvfconsulting

    jvfconsulting Active Member

    Messages:
    1,089
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    90
    #10
    The apache htacess trick seems to work just as good!
     
    jvfconsulting, Sep 1, 2011 IP
  11. amherstsowell

    amherstsowell Peon

    Messages:
    261
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #11
    It's nice thank you for sharing it, i will try it.
     
    amherstsowell, Sep 2, 2011 IP
  12. tarunmarketing

    tarunmarketing Peon

    Messages:
    121
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    wow..thanks a lot to dealeris for sharing this ht.access file important and how it is very useful for Search Engine Results Pages...keep it up.
     
    tarunmarketing, Sep 3, 2011 IP
  13. youssefedwardsaber

    youssefedwardsaber Active Member

    Messages:
    254
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #13
    really .htaccess is used for many purposes as a configuration mean for the apache server
     
    youssefedwardsaber, Sep 4, 2011 IP
  14. lovetospooge

    lovetospooge Greenhorn

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #14
    Hmm, I'll try it out. Thanks for the share.
     
    lovetospooge, Sep 4, 2011 IP
  15. Byron007

    Byron007 Active Member

    Messages:
    174
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    83
    #15
    Worth considering the point made here before redirecting 404's to the homepage

    Also info @ G Support recommending not to redirect to homepage
     
    Byron007, Sep 4, 2011 IP
  16. kittonian

    kittonian Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    While it does work, the traffic has to hit the DNS server, then the web server, then the .htaccess file, and then be converted for the page to load, whereas if you do it in DNS like it should be it's DNS server, web server, page loads. Much faster.
     
    kittonian, Sep 7, 2011 IP