How to remove 'Parent Directory' link from root folder in Apache directory listing

how to remove blackheads on nose
how to remove a tick head
how to remove a tick from a child
how to remove deep blackheads
how to remove a tick from dog
how to remove a tick without tweezers
how to remove blackheads from face
how to remove a deeply embedded tick

How can I allow directory listing in Apache for a specific (root) folder and its subfolders, but without showing a link to parent of that root folder. When user is in a subfolder, the 'Parent Directory'link is displayed to navigate to its parent, but when user is at the root folder I need to remove/hide this 'Parent Directory' link so that user cannot move above that 'root' hierarchy.

I just ran into the same issue, and this was the first search result, so I thought I'd share my solution. I don't have access to httpd-configs in my case, so I went with a different approach.

Because I won't be maintaining the indexed directory tree, I needed a solution that could exist just in the index root without any specific knowledge of its sub-directories. However, it does use an absolute path to the index root, so if your parent folder structure changes a lot, it may not work for you.

What I came up with was using a CSS URL attribute selector to hide the "Parent Directory" link when it led to the parent of the index root. It leaves a blank row, but at least it's not as intimidating as the "403 FORBIDDEN" error a user gets if they click Parent Directory one too many times.

Theoretically, the fix should be as simple as adding one line to your index root's .htaccess file:

IndexHeadInsert "<style type=\"text/css\">a[href=\"/absolute/path/to/index/root/parent/\"] {display: none;}</style>"

However, it seems that simple solution doesn't work in IE because the default doctype of the html that Apache spits out is too old to use attribute selectors.

Instead, we have to surround Apache's generated code with our own doctype using the HeaderName and ReadmeName keywords in the htaccess file. I went with the HTML5 doctype, although there may be a more appropriate one that works.

.htaccess file:

Options +Indexes

IndexIgnore "_index_header.html" "_index_footer.html"

HeaderName "/absolute/path/to/root/index/_index_header.html"
ReadmeName "/absolute/path/to/root/index/_index_footer.html"

IndexOptions +SuppressHTMLPreamble

_index_header.html file:

<!DOCTYPE html>
<html>
    <head>
        <title>title</title>
        <style type="text/css">
            a[href="/absolute/path/to/index/root/parent/"] {display: none;}
        </style>
    </head>
    <body>

_index_footer.html file:

    </body>
</html>

(Note that the CSS selector is to the index root's parent)

Works in all of the latest browser versions I tested it on (FF, IE, Chrome, Safari, Opera), and also all the way back to IE 7.

Also, now that you went through all the trouble of creating those files, you might as well make your index more snazzy. The apache doc on mod_autoindex has a bunch of options you can use to tweak things, on top of what you can do with CSS.

Tick removal: MedlinePlus Medical Encyclopedia, How do you get a tick out of your skin? Remove findgofind.com . findgofind.com is a web address belonging to a search engine that looks a lot like Google, but trust us is nothing like it.

You can hide the "Parent Directory" link by adding the following to your .htaccess file:

IndexIgnore ..

But this will hide it for every directory.

If you have access to the httpd-configs you could try to remove the directive from per-server context:

<DirectoryMatch "^/(?!var/www/your-root/subfolder)">
...
</DirectoryMatch>

As long as there is no IndexIgnore directive in an higher folder it should work for you.

Dr. Pimple Popper Teaches Us How To Remove A Blackhead, Learn the ins and outs of blackhead removal and extraction. Dr. Sandra Lee, aka Dr. Pimple Duration: 3:55 Posted: Jun 27, 2019 There are different ways to remove apps and programs, so if you can't find the one you're looking for, you can try another location. Note that some apps and programs are built into Windows and can't be uninstalled.

My solution is the following:

<Directory "/www"> Options +Indexes IndexIgnore .. _other </Directory>

<DirectoryMatch "^/www/download/.{1,}"> IndexIgnoreReset ON IndexIgnore _other </DirectoryMatch>

Tick removal and testing | Lyme Disease, If you are unable to remove the mouth easily with clean tweezers, leave it alone and let the skin heal. After removing the tick, thoroughly clean the bite area and  Remove definition is - to change the location, position, station, or residence of. How to use remove in a sentence.

How to remove wallpaper: The 7 best tips, Chuber adds that coated backing/adhesive wallpaper is not only difficult to remove, but you can expect damage to the wall after removal, which  How to Remove a Virus. This wikiHow teaches you how to remove a virus from your Windows or Mac computer. In many cases, using a combination of your computer's built-in Safe Mode and an antivirus program will be enough to remove a virus.

Netflix: How To Remove Stuff From Your 'Continue Watching' Row At , Well, you can remove those items, but it's not exactly intuitive on most devices. Netflix just introduced a way to do this on Android for the first time. You won't be able to use Facebook Login for other apps you may have signed up for with your Facebook account, like Spotify or Pinterest. You may need to contact the apps and websites to recover those accounts. Some information, like messages you sent to friends, may still be visible to them after you delete your account.

Remove Background from Image – remove.bg, Remove Image Background: 100% automatically – in 5 seconds – without a single click – for free. Learn how to delete third-party apps that you've installed on your iPhone, iPad, and iPod touch. Touch and hold the app. If you delete an app, you don't automatically cancel any in-app subscriptions that you might have subscribed to. While deleting an app, you might see a Cancel Subscriptions option. Learn how to manage your subscriptions.

Remove information from Google, Protect or remove all variations of the URL for the content that you want to hide, because in many cases, different URLs can point to the same page, for example:​  Before you try to snip off your mole with a scissors or rub on a store-bought mole cream, take a look at how and when moles should be removed.

Remove an image from Google, Remove an image from Google. If you want to delete a photo from Google's search results, you'll usually need to work with the person who owns the site that has  In Internet Explorer, select the Tools button, point to Safety, and then select Delete browsing history. Choose the types of data or files you want to remove from your PC, and then select Delete. What gets deleted when you delete your browsing history

Comments
  • Just not possible. You could write your own php script to do the directory listing. Don't see any other way. But I would not bother. The link shouldn't be there, but it's not like anything terrible will happen when you click it.
  • You are probably not asking the right question: Regardless of the link, any user can still get to the parent by removing the last folder from the URL. You need to ensure the server will not return anything on such URL.
  • The css approach seems to only hide the link (as you mention). You can use insert a <script> tag instead of a <style> and use javascript to hide the whole row. See stackoverflow.com/a/31904749/1704773 and it's comments below.
  • @itoctopus I agree. It's simple and clean. The accepted answer is a kludge.
  • This is a great option. Works perfectly. The solution will remove the link only in the /www folder but every sub folder within it will be ok. Essentially its almost like you can make your own top level directory visually.
  • no need for jquery. IndexHeadInsert "<script>if (document.location.pathname == '/') document.querySelector('tbody > tr:nth-child(3)').remove();</script>" should work fine. For some reason my "parent directory" is the 3rd row (I have a header row and a separator before the directory listing starts). Change '/' to whatever pathname you want to hide the parent link for, eg. '/builds/' - it should automagically be hidden for a root pathname anyway.
  • I had to change your answer to this IndexHeadInsert "<script>document.addEventListener('DOMContentLoaded',function() {if (document.location.pathname == '/sub-folder/') document.querySelector('tbody > tr:nth-child(3)').remove();},false);</script> This forces the javascript to execute once the DOM is ready