Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

htaccess question

  • 14-03-2007 02:35PM
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    hi

    I created a newsletter directory to put HTML files.

    I’d like to block the access to http://www.domain.com/newsletter/ but not to the newsletters themselves.

    I can’t remember how to do that.

    does anyone know ???


Comments

  • Registered Users, Registered Users 2 Posts: 3,514 ✭✭✭Rollo Tamasi


    I'm not 100% on what you want to do.
    Do you have files in a dir which you don't want listed if they go to domain.com/dir? If that's the case then you need to prevent directory listing via a .htaccess file, put this line in a .htaccess file and save it in the dir - IndexIgnore * - You could just put a blank index.html file in the directory too.


  • Registered Users, Registered Users 2 Posts: 568 ✭✭✭phil


    Standard Unix permissions will help you here as well.

    Providing you own the directory and aren't the user who runs Apache, then:
    $ chmod 711 dirname
    

    If non-octal permissions make more sense use:
    $ chmod u=rwx,g=x,o=x dirname
    

    That means read, write and execute permission for you (i.e. full control), and only execute permissions for everyone else

    Execute-only permissions on a directory means you can read files from the directory but only if you know their full name. You cannot get a directory listing.

    Phil.


  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    An alternative would be to just throw in an index file into that folder thats empty hence they won't get a directory listing ? as I believe you still want people able to see ... /newsletter/januarynewsletter.html ? if they so wish ?

    edit: just saw "Rollo Tamasi" .. blank index file .. :D


Advertisement