1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

.htaccess

Discussion in 'Web Development' started by codynanney, Dec 23, 2007.

  1. codynanney

    codynanney New Member

    Joined:
    Dec 23, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Im not sure if this is the right section to post this but I will try it. I am having a really hard time trying to set up a ,htaccess for my site so I have a couple of questions. First if I want to protect a single page where would I put the .htaccess file? Inside a folder with the page? or somewhere else. Second when I am creating my full server path do I have to include the path through the folders like i would a url or is this something completely different? I can use any help I can get.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    I have moved it to the last section and as far as I know of .htaccess it should always go into the root folder of your web server but that is not a restriction and you can put them in any folder you wish to.
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    1) You have to put the .htaccess file in the directory where the file you want to protect resides.
    2) URL path & Server filesystem path usually are quite diferrent, for example you have hosted your pages on a shared server for the domain xxyy.com, so your server filesystem path might look like /share/xxyy.com/public_html/index.html while the URL looks like http://xxyy.com/index.html
     
  4. urstop

    urstop New Member

    Joined:
    Oct 17, 2007
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    .htaccess can be placed either in your root directory or directly in the folder that contains the file to be protected.

    A .htaccess that is a root directory can have settings that apply to all the subdirectories.

    and

    A .htaccess that is a root' sub directory can have settings that apply only to itself.
     

Share This Page