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
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

Cosmos

Yakın Zamanda Gönderilenler

The Key Benefits of SEO Compatible Web Design

The Key Benefits of SEO Compatible Web Design The Key Benefits of SEO Compatible Web Design. Search Engine Optimization (SEO)…

2 years öncesi

Boost Your Business with Cosmos Design

Boost Your Business with Cosmos Design Boost Your Business with Cosmos Design. In the digital era, having a strong online…

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

Web Design Prices

Web Design Prices Web design prices can be prepared specifically for the sector and project. If you want to set…

4 years öncesi

Harmful Backlink Removal Service

Zararlı Backlink Temizleme Hizmeti (Toksik) Zararlı Backlink Temizleme Hizmeti SEO çalışmalarının en önemli parçalarından biri,  backlink olarak bilinen geri bağlantılardır.…

4 years öncesi

SMM Panel Script

SMM Panel Script Free SMM Panel Script is a free SMM panel script coded in PHP, with a nice design…

4 years öncesi