Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Basic .htaccess Question

Discussion in 'General Discussion' started by Kenny M., Apr 11, 2018.

  1. Kenny M.

    Kenny M. Registered

    Mar 21, 2017
    Likes Received:
    Trophy Points:
    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 (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.


  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Nov 14, 2017
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    Hi @Kenny M.

    You can just put this in the public_html and it is recursive so it will affect any directories below.

    This will allow localhost access to the page over http

    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,
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice