Not sure how to make a dot htaccess file. What I would like to do is use it to block ips to my host, and I am not sure how to do this. Anyone know how to do this and wouldn't mind explaining how to do this? Thanksf or any help.
Not sure how to make a dot htaccess file. What I would like to do is use it to block ips to my host, and I am not sure how to do this. Anyone know how to do this and wouldn't mind explaining how to do this? Thanksf or any help.
You dont need to create .htacess file, it is a hidden file in your file manager... If your using cpanel, there is an option to block ips..
An .htaccess file is a simple text file. To block IPs, create a file called .htaccess in your root folder (alongside your home page) that contains the following lines:
This will allow all traffic, except that from the single IP address 1.2.3.4, as well as any IP address from 2.3.4.1-2.3.4.255. Blocked visitors will see the error message "Your IP Address has been blocked...". You can of course edit this message. However, you can not serve a custom error document, since access to that error document will also be blocked.Code:Order Allow, Deny Deny from 1.2.3.4 Deny from 2.3.4 Allow from All ErrorDocument 403 "Your IP Address has been blocked from accessing this server."
Note: Using this code does require that your ISP allow you to customize your server using .htaccess, and the ErrorDoc line will only work if your ISP has enabled that functionality.
The best way to learn anything, is to question everything.
WigeDev - Freelance web and software development
Thanks very much, I will give it a try.