How do I disable directory browsing on chrome developer mode Source panel

Can anyone teach me this?
To make you clear when you go developer mode in chrome you may view the directories and source files of the website can anyone provide me idea to disable that ? I don’t use wordpress so any solution regarding .htaccess file modification is appreciated.

Add the following code in your .htaccess file located in the \htdocs directory.

# DISABLE DIRECTORY INDEXES
Options -Indexes

Hope it helped!

1 Like

You can take down your website and block anyone but you from visiting it. If that’s not an option, there is not much you can do.

Websites work by sending the web page and any linked assets to the browser, where they browser may render them. Most browsers also offer tools to inspect what content is being sent by the website. This is done on the device of the visitor, and is not something you have any control over as a website owner.

Some website owners choose to block right clicks and the F12 key to make it harder to open the developer tools. But then people can still open it from the browser menus, so it’s just obnoxious for people who want to right click a link for example without adding any security.


Also, the “directory browser” only exposes files that you have linked to from the web page. Browsers can’t automagically find all the files in a folder.

1 Like

That line only helps to disable direct directory browsing, for example it helps when you want to disable directory browsing for someone who is playing with you URL but my concern here is about how to disable directory browsing through google chrome developer mode → source panel. Please check the screenshot below to better understand my query. And I already have that code " Options -Indexes " in my .htaccess file

This happens for every website, and I think that there is no security issues with this.

Here’s one with no access directory contents except for index.html


.

what do you mean?

I mean there is no access to image, video, js or css directories, only index.html is available in developer tools.

This might help:
View page resources - Chrome Developers

And a long list of other domains, including various CDNs they use to serve all the other assets.

They are not “hidden” or “disabled”. Just served from different domains.

You can’t disable this. This is how websites work.

2 Likes

Thanks now I get it.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.