Bypass htaccess Using Hosts File On Local PC ?

Dushy Squirt

Member
Mar 7, 2013
13
0
1
cPanel Access Level
Website Owner
Hi,

If I have a htaccess file setup using cPanel in the public_html directory of a website to only allow specific IP's through to view the site can this be bypassed by adding a line to the hosts file on anyones local PC.

For example, if I added the line

domain.com 127.0.0.1

to the host file of anyones local PC where that local PC IP address was not in the website htaccess file will that PC be able to view the website?


Thx
 

quizknows

Well-Known Member
Oct 20, 2009
1,008
86
78
cPanel Access Level
DataCenter Provider
The hosts file on your local machine is only used to (re)define IP's for domain names. For example if you were migrating a site, you can change your local 'hosts' file to point to the new server instead of where DNS resolves. Assuming you don't use a proxy, your local 'hosts' file will not cause a remote server to see you as coming from a different IP. You can't bypass .htaccess restrictions on a remote sever this way.