Blog

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.

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/de
ErrorDocument 401 https://cosmosweb.uk/de
ErrorDocument 402 https://cosmosweb.uk/de
ErrorDocument 403 https://cosmosweb.uk/de
ErrorDocument 404 https://cosmosweb.uk/de
ErrorDocument 405 https://cosmosweb.uk/de
ErrorDocument 406 https://cosmosweb.uk/de
ErrorDocument 407 https://cosmosweb.uk/de
ErrorDocument 408 https://cosmosweb.uk/de
ErrorDocument 409 https://cosmosweb.uk/de
ErrorDocument 410 https://cosmosweb.uk/de
ErrorDocument 411 https://cosmosweb.uk/de
ErrorDocument 412 https://cosmosweb.uk/de
ErrorDocument 413 https://cosmosweb.uk/de
ErrorDocument 414 https://cosmosweb.uk/de
ErrorDocument 500 https://cosmosweb.uk/de
ErrorDocument 501 https://cosmosweb.uk/de
ErrorDocument 502 https://cosmosweb.uk/de
ErrorDocument 503 https://cosmosweb.uk/de
ErrorDocument 504 https://cosmosweb.uk/de
ErrorDocument 505 https://cosmosweb.uk/de
# 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

Cosmos

Yakın Zamanda Gönderilenler

Wie Cosmos Design Ihr Unternehmen von der Konkurrenz abheben kann

Wie Cosmos Design Ihr Unternehmen von der Konkurrenz abheben kann Wie Cosmos Design Ihr Unternehmen von der Konkurrenz abheben kann.…

2 years öncesi

Die Geheimnisse für einen erfolgreichen Online-Auftritt im Web

Die Geheimnisse für einen erfolgreichen Online-Auftritt im Web Die Geheimnisse für einen erfolgreichen Online-Auftritt im Web. Ein erfolgreicher Online-Auftritt ist…

2 years öncesi

SEO-freundliches Webdesign

SEO-freundliches Webdesign SEO-freundliches Webdesign. Im digitalen Zeitalter ist ein attraktives und benutzerfreundliches Webdesign von entscheidender Bedeutung, um potenzielle Kunden anzusprechen…

2 years öncesi

Wie Cosmos Design Ihr Unternehmen stärken kann

Wie Cosmos Design Ihr Unternehmen stärken kann Wie Cosmos Design Ihr Unternehmen stärken kann. Ein professionelles Web-Design ist heutzutage von…

2 years öncesi

Webdesigns für Unternehmen

Webdesigns für Unternehmen Webdesigns für Unternehmen. Die Bedeutung von professionellem Webdesign für Unternehmen kann nicht genug betont werden. In diesem…

2 years öncesi

Make a Difference with Germany’s Best Web Design and SEO Services

Make a Difference with Germany's Best Web Design and SEO Services In today's digital age, having a successful online presence…

2 years öncesi