ende

Hiding Website File Directory with Htaccess

Hiding Website File Directory with Htaccess

Hiding Website File Directory with Htaccess

Hiding Website File Directory with Htaccess Many websites serve on the Internet. For every website, there are many images, text, php, xml etc. in the background. There are files such as and folders containing them. Thanks to those files, we see a web page as it is. The files or folders under our site normally appear as a list when we select the extension in the search bar. But this poses a security problem for a website. After all, this is a simple image at the bottom of our website, and it is kept in files containing our site’s settings. We must prevent outsiders from accessing these files.

Htaccess ile Web Sitesi Dosya ve Dizin Listelemeyi Gizleme

Turning Off File – Directory Listing (Joomla, WordPress etc.)

To close the listing, we must add a command to our .htaccess file. From our web panel, we enter the public_html folder where our web files are located. We open the .htaccess file in this folder. Then we write the following line of code into this file.

Options All -Indexes

After writing this code, we save and close it. In other words, we add a line of code to our .htaccess file on the web. Now, when someone searches any folder in the browser (Chrome, Microsoft Edge, Mozilla, etc.), they will encounter a 403 error page because they will not have permission to access the folder. If we do not want the user to see error pages, we can redirect them to a page where we want the error pages. You can redirect all errors to your home page by writing your own home page for error pages as follows. If you want to redirect pages with 403 errors, you can do so by just typing that code without typing other error codes. Hiding Website File Directory with Htaccess

Redirecting Web Error Pages

# BEGIN Error Pages
ErrorDocument 400 https://cosmosweb.uk
ErrorDocument 401 https://cosmosweb.uk
ErrorDocument 402 https://cosmosweb.uk
ErrorDocument 403 https://cosmosweb.uk
ErrorDocument 404 https://cosmosweb.uk
ErrorDocument 405 https://cosmosweb.uk
ErrorDocument 406 https://cosmosweb.uk
ErrorDocument 407 https://cosmosweb.uk
ErrorDocument 408 https://cosmosweb.uk
ErrorDocument 409 https://cosmosweb.uk
ErrorDocument 410 https://cosmosweb.uk
ErrorDocument 411 https://cosmosweb.uk
ErrorDocument 412 https://cosmosweb.uk
ErrorDocument 413 https://cosmosweb.uk
ErrorDocument 414 https://cosmosweb.uk
ErrorDocument 500 https://cosmosweb.uk
ErrorDocument 501 https://cosmosweb.uk
ErrorDocument 502 https://cosmosweb.uk
ErrorDocument 503 https://cosmosweb.uk
ErrorDocument 504 https://cosmosweb.uk
ErrorDocument 505 https://cosmosweb.uk
# END Error Pages

As a result, if your site is WordPress, you will hide your important content such as wp-admin hiding, wp-content hiding, wp-include hiding. WordPress file and directory hiding is done in the same way as Joomla file and directory hiding. You will also close your site to index searches. Your site will be in a better position in terms of SEO. Hiding Website File Directory with Htaccess

07.07.2022
847
Comments

No comments yet. You can be the first filling the form below.

Whatsapp
Cosmos
Cosmos
Hello
How can we help you?
Copy Protected by Chetan's WP-Copyprotect.