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 917403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:12:22+00:00 2026-05-15T18:12:22+00:00

There is this PHP script on my website which I don’t want people to

  • 0

There is this PHP script on my website which I don’t want people to be able to run by just typing its name in the browser.

Ideally I would like this script to be run only by registered users and only from within a Windows app (which I will have to provide). Can this be done ?

Alternatively, how can I protect this script so that it can only be called from a specific page or script?

Also how can I hide the exact URI from appearing on the address bar?

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-05-15T18:12:22+00:00Added an answer on May 15, 2026 at 6:12 pm

    If you are running Apache for your webserver, you can protect it with a username/password combo using .htaccess. It takes a little configuration if your server is not already configured to allow .htaccess. Here are the Apache docs.

    If you need authentication based on application-specific factors, you can put something at the top of your script like

    <?php
      if(!$user->isLoggedIn()) {
        // do 404
        header('HTTP/1.0 404 Not Found');
      }
    

    Do you have a question about how you would implement isLoggedIn?

    You can also use mod_rewrite to rewrite URIs, and those directives can go inside your .htaccess as well. mod_rewrite can rewrite incoming requests transparently (from the browser’s perspective) so a request for /foo/bar can be translated into secret_script.php/foo/bar. Docs for mod_rewrite.

    However you decide to implement this, I would urge you to not rely solely on the fact that your script’s name is obscure as a means to secure your application. At the very least, use .htaccess with some per-user authentication, and consider having your application authenticate users as well.

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

Sidebar

Related Questions

Examine this example. It is in PHP, but you should be able to pick
I have a wordpress website, and I want to create a simple web commerce.
I know that this is a popular topic, but I've yet to find an
Problem I have a file which contains such text (nothing else) 2010-10-05 I would
I am developing a project at work for which I need to create and
I'm having this problem with my AJAX, where it's not working in IE, but
I want to limit access to files in Apache. A list of restricted files
I've recently come across a website project where the client wants me to dynamically
On my server, a website resides within a directory similar to /domains/domain.com/public_html . I
I need help in building custom search engine for my website http://www.go4film.com . Although

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.