Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:15:53+00:00 2026-06-13T04:15:53+00:00

I have a folder which contains an admin panel – no password or session

  • 0

I have a folder which contains an admin panel – no password or session management is on the script. The URL is complex to get too. To save time before making an admin login system. Can I restrict a folder and all sub folders and files via .htaccess or should I make a PHP include which checks an Array list of IPs and then just does die() or redirect Header() to external source?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:15:55+00:00Added an answer on June 13, 2026 at 4:15 am

    Using .htaccess sure will be easier since you don’t have to write a wrapper around any non-php file that might exists in your directories.

    You will first Deny from all and then use Allow from ip.ip.ip.ip to allow a certain ip to get access, repeat step #2 as many times as neccessary.

    Order deny, allow
    Deny from all
    
    Allow from 127.0.0.1
    Allow from 192.168.1.13
    

    Using PHP you could check whether $_SERVER['REMOTE_ADDR'] is in your array of valid ips, if so grant the user access… otherwise; HALT!

    if (in_array ($_SERVER['REMOTE_ADDR'], array ('127.0.0.1', '192.168.1.13')) == false) {
      die ('restricted access');
    }
    

    post written and edited using my blackberry, sorry for any minor errors (including formatting)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Admin folder which contains 4-5 aspx pages. I want to that
I have a folder which contains few files and some directories which I need
I have a folder which contains doc, docx, xlsx, pdf and txt files. I
I have a image folder which contains sub directory for each album of images
I have a folder, which was a git repo. It contains some files and
I have a folder which contains a list of files. The problem is they
I have a folder called Client which contains many subfolders. I want to create
I have a folder in my website which contains another folder which contains many
I have a c:\config folder which contains several configuration files (config_x). I would like
I have a folder which contains some subversion revision checkouts (these are checked out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.