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

  • Home
  • SEARCH
  • 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 9217599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:40:07+00:00 2026-06-18T02:40:07+00:00

I want to protect a URL in my site For exapmle: www.mysite.com/admin using user

  • 0

I want to protect a URL in my site For exapmle: http://www.mysite.com/admin using user “Login”
I don’t want to let anyone see any content in the “admin” directory not even a picture or any other file. How could this be possible? i have read about the sessions and all but that can stop a user to access a webpage. I am familiar with PHP. Please help!

  • 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-18T02:40:08+00:00Added an answer on June 18, 2026 at 2:40 am

    It’s a little bit ugly, but the easiest way would be to password protect the directory, which would bring up an authentication pop-up type box to the browser. If you are using Apache, you can find out more information in the Apache docs. If you are using another server, they will likely have similar docs available somewhere. This can also be done directly by PHP by sending the correct header in order to authenticate against a database instead of storing the users’ information in a text file.

    If you are looking to make it seamlessly integrate into your site (i.e. without the ugly pop-up), it is a bit more difficult, but doable. The PHP files are easy. Just write some sort of code to determine if the user is logged in, and if not, don’t show the content. However for the images or other static files, I would recommend doing something like this: Echo/print a jpg-image with php, for safety?

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

Sidebar

Related Questions

I have a user specified URL that has a wildcard in it, e.g. http://example.com/project/*/account
I'm developing a website using php, i want to know how can i protect
I am using cakephp for my new project.I want to secure my site with
I want to password protect my page which I am doing using LDAP bind
What's the best way to protect against dynamic file access using URL variables? I'm
I want to protect my website against spambots with javascript. I found this code,
I want to protect a directory and the php files in it, from direct
I have a server application which I want to protect from being stopped by
I have developed a small application and now i want to protect it. I
i search online but can't get satisfactory result i want to protect images on

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.