.htaccess file?

Discussion in 'HTML & Website Design' started by xplicit702, Jan 15, 2009.

  1. #1
    Does a site have to have a .htaccess file? If so, how do you make one? Is there a basic general file I could copy/paste for my site? I really don't even know what they are for, just some of my sites have them and some do not.
     
    xplicit702, Jan 15, 2009 IP
  2. -58-

    -58- Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe it will be available when you upload your website to a web hoster. It was for me, and from what I learned the other day here, one of it's primary functions is to direct visitors to the first page in your website. So if it's going to be index, home, default.(xxx) (html, htm, php etc.) or one of the common homepage files you shouldn't need to worry about it. But if you want the visitor to go to a splash page before your home page it's worth changing.

    (Below from Steelfrog)
    To change it just download it from your hoster and change or add the following value:

    DirectoryIndex filename.html
    Code (markup):

    You can add additional pages to the end of that too, in case you decide to change it, or use it for a temporary period of time.

    Hope this helps!
     
    -58-, Jan 15, 2009 IP
  3. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #3
    No web site must have a htaccess file and, if you don't know what it is and everything is working, don't worry about it.
     
    drhowarddrfine, Jan 15, 2009 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    Good answer right above.

    If you should change any setting in your control panel that requires an addition to the .htaccess file then the conrol panel will create one or write to the existing one.
     
    Colbyt, Jan 16, 2009 IP
  5. revoD

    revoD Peon

    Messages:
    120
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Like others have said a .htaccess file is not necessary to have a website function. It is useful for certain functions like URL rewrites.

    They can be created by using notepad or basic text editor and saving it as .htaccess.
     
    revoD, Jan 19, 2009 IP
  6. pageloadtime

    pageloadtime Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    guide to htaccess

    javascriptkit.com/howto/htaccess.shtml
     
    pageloadtime, Jan 19, 2009 IP
  7. Irfi0009

    Irfi0009 Banned

    Messages:
    17,584
    Likes Received:
    33
    Best Answers:
    1
    Trophy Points:
    48
    #7
    .htaccess file is not required for normal website operations. It is basically a url rewrite command file. You can redirect static urls on dynamic ones even if the static URL you entered doesn't exist. In simple words, you can create static URL for dynamic urls. If you are using an application which is using url rewrites to make your urls SEO friendly then your website might need the htaccess file, in this case deleting this file will result in a broken website. You need to make sure before deleting this .htaccess file
     
    Irfi0009, Jan 20, 2009 IP
  8. plugandplay

    plugandplay Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    A site does not HAVE to have one. They can be very useful and certain programs/script will require one, but they will tell you what you need to do to create one. Also the tech support of your host should be able to help you if and when you need one.
     
    plugandplay, Jan 20, 2009 IP
  9. t2000q

    t2000q Prominent Member

    Messages:
    4,636
    Likes Received:
    192
    Best Answers:
    0
    Trophy Points:
    300
    Digital Goods:
    1
    #9
    .htaccess file is not required for your site but there are benifits to having one like having your all your domains forward to have the www on it or not, this will make sure all the link creadit from other sites get applied to the main domain that you want since google often recgonizes both www.yourdomain.com and yourdomain.com and will sometimes give them different PR, you can also use it define a 404 page and many other functions, just google it to get many easy examples
     
    t2000q, Feb 3, 2009 IP