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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:08:22+00:00 2026-05-16T00:08:22+00:00

Is it possible to kind of force a 403 or 404 error? I have

  • 0

Is it possible to kind of force a 403 or 404 error?

I have a kind of admin page, where I am trying to prevent hackers from getting into my filesystem on my server. (the path get’s delivered over the url and it would be possible to just pass a ../ into it and get up in my filestructure – I know that’s not a good thing to do it). Anyway If somebody tries to enter a ../ into my url I am currently just using a die(‘forbidden’) to make sure that this area on my server is forbidden.

I was wondering now if it’s actually possible to kind of fire a real forbidden 403 error? I’ve defined a 403 page in my .htaccess document which shows up if it’s a real 403. Is it possible to kind of fire a 403 so that the .htaccess links to the 403 page. I mean I could easily hardcode it and simply link to the 403 error page. I just wondered if this is possible?

  • 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-16T00:08:22+00:00Added an answer on May 16, 2026 at 12:08 am

    Just issue

    header("HTTP/1.0 403 Forbidden");
    

    before any other output.

    Also make sure you double, and triple check your path sanitizer.

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

Sidebar

Related Questions

Would be possible to extend this kind of layout so that I can have
I have kind of reports about students accounts is it possible to print it
Is it possible to make some kind of link from SQL to Excel making
Is it possible, through some kind of metadata presumably, to force a property of
Is it possible to implement some kind of timeout (time limit) for fork using
Is it possible to use some kind of JavaScript to change or set a
Is it possible to trigger some kind of signal or configure a hook (e.g.
Possible Duplicate: Android Layout and positioning issue Design layout which support for all kind
Just for kind of fun I'm developing almost every algorithm (if possible) shown in
I'm wondering if this kind of thing will ever be possible in PHP (and

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.