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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:00:44+00:00 2026-05-22T16:00:44+00:00

I am very new to Apache and .htaccess, and I had a simple question

  • 0

I am very new to Apache and .htaccess, and I had a simple question regarding how to handle 403 and 404 errors with Apache’s ErrorDocument command.

Let’s look at this code from an early CMS I wrote:

ErrorDocument 404 /admin/includes/access_deny.php?error=404

This will silently redirect the user to http://www.mysite.com/admin/includes/access_deny.php?error=404 when they get a 404 error.

Here is my problem, this error document will always be in the same place, with regards to the .htaccess file. However, if I need to move my installation, say to the directory subfolder, I will need to open the .htaccess file an update the to following, for it to work correctly:

ErrorDocument 404 /subfolder/admin/includes/access_deny.php?error=404

Is there a way I can have .htaccess redirect to this page admin/includes/access_deny.php?error=404 in regards to the file itself, not an absolute URL? Also, no matter where I would move the installation in the future, Apache will catch all 404 errors that are on the same level or sub-directories to this file.

Please let me know if that is not clear.

Thank you for your time.

  • 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-22T16:00:45+00:00Added an answer on May 22, 2026 at 4:00 pm

    From the manual:

    URLs can begin with a slash (/) for local web-paths (relative to the DocumentRoot), or be a full URL which the client can resolve. Alternatively, a message can be provided to be displayed by the browser.

    This thread may help you fix it though.

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

Sidebar

Related Questions

I am very new to apache and django, so execuse me if this question
I'm very sorry for such a simple question-- I'm new at WSGI development, and
I'm VERY new to Java, so I'm hoping this is an easy question. I'm
I am very new to Apache camel and I am exploring how to create
I am very new to Web Services. I am creating Apache CXF (apache-cxf-2.5.0) SOAP
I am very new to creating webservers - and I have had several goes
I am very new to these issues, please help. I have two questions regarding
I am very new to apache mina and I have a problem with sending
Very new to python and can't understand why this isn't working. I have a
Very new to C++ and Cocos2d-x but I was just toying around with CCArray

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.