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.

Explain .htaccess file

Discussion in 'Apache' started by star2323, Nov 10, 2005.

  1. #1
    I hear people talking about the .htaccess file and how it is important when making pages search engine friendly. Can somebody explain this file to me and what exactly it does, where it is located, what system it runs on, etc....

    Thanks
     
    star2323, Nov 10, 2005 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just-4-teens, Nov 10, 2005 IP
  3. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
  4. Janice149

    Janice149 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I use mine to redirect http://website.com to http://www.website.com
     
    Janice149, Nov 10, 2005 IP
  5. xponse

    xponse Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    For SEO point of view mainly it requier for redirection purpose.

    Redirection can be perform in following ways:

    1) Meta referesh
    2) JS or other server scripts.
    3) .htaccess file.

    Mainly google do not like redirection other than .htaccess
     
    xponse, Nov 10, 2005 IP
  6. xponse

    xponse Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Did that work ??

    onces I used above code, but it did not perform, after that I use following code, and it works perfectly.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
    RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]
     
    xponse, Nov 10, 2005 IP
  7. webdesign2005

    webdesign2005 Guest

    Messages:
    26
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    .htaccess is usually placed in your root directory of your site.

    You can place .htaccess file in any directory where you wish to do certain things.

    All firectories beloww the folder that contains a .htaccess file will be affected by the commands in said fille.

    It is used primarily on Unix and Linus systems.

    On Unix like systems files that are hidden start with a period.

    Most people use it for redirection. You place Mod Rewrite rules in here to. You can use this file to prevent access to a site by using enviromential variables.

    You can find a very short primer on it here http://biyw.com/buildwebsite/htaccess/htaccess
     
    webdesign2005, Nov 10, 2005 IP