What is .htaccess file?

Discussion in 'PHP' started by mindblaster, May 12, 2011.

  1. #1
    Can any one tell me what is the .htaccess file, and how to create it. what is the usage
     
    mindblaster, May 12, 2011 IP
  2. staygolden

    staygolden Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't post a link, but try searching Google for htaccess, and I'm sure you will find what you're looking for.
     
    staygolden, May 12, 2011 IP
  3. nihangshah

    nihangshah Prominent Member

    Messages:
    5,536
    Likes Received:
    271
    Best Answers:
    3
    Trophy Points:
    395
    #3
    htaccess are server configuration files. They are used to shorten URL's, block IP addresses or domains, etc.
     
    nihangshah, May 12, 2011 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Bohra, May 12, 2011 IP
  5. andrewgail

    andrewgail Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    htaccess file allow us to make configuration changes on a per-directory basis. .htaccess files provide a way to make configuration changes on a per-directory basis. A file, absolute one or added agreement directives, is placed in a accurate certificate directory, and the directives apply to that directory, and all subdirectories thereof.
     
    andrewgail, May 13, 2011 IP
  6. KittyS

    KittyS Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This tool is FREAKING AWESOME for managing it. HTACCESS can be confusing - even for experienced programmers, which I am (15 years now). So when I looked at editing my .htaccess a couple of days ago (I needed to redirect a file that google cached - hard - to the new file with a 301 redirect), I used this to generate. Just remove the "//"s the tool puts in there, because it gave me some errors when I had those there.

    I solved a pretty f***ed up problem with this tool. It's free and I don't have any "game" with it. I just happened to see your post and love this tool.

    BEFORE you edit this file, download it so you have a backup.

    http://www.htaccessredirect.net/index.php
     
    KittyS, May 13, 2011 IP
  7. JoelLarson

    JoelLarson Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    A .htaccess is an Apache configuration file. By default, Apache has it as "HyperText Access".

    You can think of a .htaccess file as a httpd.conf file, or Apache's main config file. By using .htaccess in your directories, you can overwrite certain Apache configurations to customize it specifically for your application, but not for the entire server.

    To create a .htaccess file in Windows, the easiest way is opening Notepad and doing a "Save As". Then you save the file as ".htaccess" (including the quotes around it). Then you can edit your file and everything will work properly. NOTE: It may not show up if you have file extensions hidden in Explorer: http://windows.microsoft.com/en-US/windows-vista/Show-or-hide-file-name-extensions
     
    JoelLarson, May 13, 2011 IP
  8. jazzzyman

    jazzzyman Well-Known Member

    Messages:
    117
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #8
    yeah the title explains the post
    if you want to block access your best using a robots text file
    .htaccess file is also a good place to put in a 404 page 301 to a page of your choise. just cant remember if it lowered rankings at all. hmm might get onto that one
    so say someone types the wrong page then they would be redirected to say your homepage for example
    also a good idea to 301 www.yoursite.com/inex.html or equiverlant to http://www.yoursite.com

    another good thing to do would be to 301 all upper and mixtUre case page names to lower case. bit of mucking around but worth it
     
    jazzzyman, May 14, 2011 IP