![]() ErrorDocument 400 /errors/400.html Protect your directories with a password For example, the following line of code will display a page called 400.html, present inside the errors directory. htaccess file, you can define a custom error page for every HTTP error code that your server produces. They hate them less when the error page tells them exactly what’s wrong, in a user-friendly way. Let’s look at a few: Display custom error pages There is a multitude of cool features that you can implement via a. Once you’re done adding code, click Save Changes and Close. Copy the code you want to add and paste it inside the text space. Unless you know what you’re doing, ignore the prompt and click Edit.Ī file editor should open. You will be prompted to enable/disable Encoding Check and select a character encoding for the file. To edit the file and/or add code to it, right-click it and select Edit. htaccess as the name of the file, and click Create New File Once inside your public_html folder, click the +File icon in the top-left corner.Click the Settings icon on the top right, and then check the Show hidden files checkbox.Click the File Manager icon under Files.htaccess file through the steps shown above, it’s likely that you don’t have it. If you don’t find it there, you’ll have to create one. Scroll down to your public_html folder and double-click it to check inside for the. htaccess file on cPanel, follow these steps:Ĭlick the Settings icon on the top right, and then select the Show Hidden Files (dotfiles) and click Save. This is because most, if not all, of the configuration directives, work better when defined in the main configuration file. htaccess files if you don’t have access to the main configuration file (e.g. These files have the same syntax as the main Apache configuration files.Īs per the official Apache documentation, you should only use. ![]() This allows you to customise the Apache server’s behaviour for different directories. htaccess file apply to the directory, and all its subdirectories. The configuration directives defined in a. This includes redirecting URLs, caching, enabling HTTPS, hotlink protection, and setting up custom error pages. ![]() htaccess is a hidden configuration file that lets you configure various features of the Apache web server, on a per-directory basis.
0 Comments
Leave a Reply. |