Kenny M.

Registered
Mar 21, 2017
3
0
1
New York, NY
cPanel Access Level
Root Administrator
I've played with .htaccess before but not to this level.

We have a site still in development, when complete.
I need to restrict the site so it can only be accessed by 4 IP's at least for now.
That part I have found on my own.

Order deny,allow
Deny from all
Allow From 127.0.0.1 (Do I need this for the site to function?)
Allow from XXX.XXX.XXX
Allow from XXX.XXX.XXX
Allow from XXX.XXX.XXX
Allow from XXX.XXX.XXX
Options -Index (Stop search engine indexing and directory listing, I believe?)

My main question is can I just dump this in Public_HTML and configure the website to use this globally or do I still have to place a copy in every folder?

I'm running on a GoDaddy VPS server though I don't think that matters.

Thanks,

Kenny
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
7,995
645
263
Houston
cPanel Access Level
DataCenter Provider
Hi @Kenny M.

My main question is can I just dump this in Public_HTML and configure the website to use this globally or do I still have to place a copy in every folder?
You can just put this in the public_html and it is recursive so it will affect any directories below.

Allow From 127.0.0.1 (Do I need this for the site to function?)
This will allow localhost access to the page over http

Options -Index (Stop search engine indexing and directory listing, I believe?)
Apache's documentation on what this directive does is here:

core - Apache HTTP Server Version 2.4

-Indexes will do the opposite of what +Indexes does

Thank you,