Apache Parent Directory

parttimetechie

New Member
Reaction score
0
I want to hide the Parent Directory link when someone calls up a directory listing of a certain folder. I am unsure how to do this in apache. Precise instructions would be best, as I have read "go near indexoptions and add indexignore..." but that doesn't seem to be working for me.

Thanks
 
yeah, you would place the apache directive in a file named:

.htaccess

in what ever directory you want it to affect.
 
So I make a file .htaccess in the actual server directory or in the httdocs page? Is it a .html or .txt or what? I need a bit more than what you are giving me to understand it.
 
It is a plain text file, with no real name, just an extension per se.


hidden files in the unix world start with a period. htaccess files are named as a hidden file so that they won't show up in directory listings

Place it in the directory that you do not want to show the parent directory.

name it:

.htaccess


it is just a plain text file that would contain only one line:

IndexIgnore ..
 
I made a file .htaccess without any acompanying .txt or.html after it and placed it in the directory above my particular folder and in my particular folder. I am still able to see the parent directory when I am in that folder, taking me up one "level" which I do not desire. Please assist.
 
I do not want to disable directory listing, I just don't want people to be able to get into a file level above the directory I want them to see. Hope this makes sense.

I tried that code generation, but none of the options are what I want to do..or else I don't know what I'm looking for.
 
I would create an index.html file and list the files or directories you want shown.

You can make the index.html file look exactly like the current listing page pretty easily.
 
What exactly are you trying to do? Do you want to hide the link to the parent directory? Do you want to hide the files in the parent directory? Do you want to deny access to the parent directory?
 
If I have a file at blah.com/bee. I want people to be able to access the directory blee but NOT be able to tap "Parent Directory" and go up to blah.com.

Does that make sense?
 
What about putting a 301 redirect in the .htaccess of blah.com to redirect to blah.com/bee.

That way when they try to go up to the Parent Directory they are redirected back to the blah.com/bee directory that they are in.
 
Back
Top