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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:33:22+00:00 2026-06-12T02:33:22+00:00

I want to make apache to always open up a signle page for 404

  • 0

I want to make apache to always open up a signle page for 404 errors from all subdomains.

The problem is that my subdomains are located in subfolders in public_html, and thus have a different root path.

For example the main domain this works quite well:

ErrorDocument 404 /Error/404.html

The Error folder and the main domain are located in public_html respectively.

However for the forum subdomain, located in public_html/forum/ the above root path does not, and it actually looks for public_html/forum/Error/404.html which doesn’t exist.

I tried to rewrite rule for the forum folder, but it didn’t work out either:

ErrorDocument 404 /../Error/404.html

Seems, it cannot go below the root folder for some reason.

Any ideas how can I refer to the same page from the main and the subdomain alike, without triggering redirects? (eg: http://mysite/Error/404.html would accomplish this, but would also change the url address of the page which I don’t want)

  • 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-12T02:33:23+00:00Added an answer on June 12, 2026 at 2:33 am

    Seems, it cannot go below the root folder for some reason.

    Because being able to traverse above the document root is a very, very serious security risk. If your webserver gets compromised, people would be able to serve all kinds of files anywhere on your entire server.

    If you have access to server config you can setup aliases for the /Error folder. For example, in your forum subdomain’s vhost config, you can add:

    Alias /Error /path/to/public_html/Error/
    

    This way, when you go to http://forum.yourdomain.com/Error/404.html you’d actually be looking at http://main.yourdomain.com/Error/404.html. Then you can just use:

    ErrorDocument 404 /Error/404.html
    

    like normal in your forum subdomain.

    But if you don’t have access to your server/vhost config, you’ll need to use mod_proxy and mod_rewrite. So in the htaccess file in public_html/forum/, add these to the top:

    RewriteEngine On
    RewriteRule ^Error/(.*)$ http://main.yourdomain.com/Error/$1 [L,P]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Apache server I want to make this redirection : everything that comes
I want to make an etag that matches what Apache produces. How does apache
I want make a bash script which returns the position of an element from
I want to make a unique forum signature from my latest watched animes in
i use struts 1.3 and want to make localization. that's what I'm doing: in
Greetings, I want to write a unit test to make sure that our web
I am having the next problem: I want to log the SOAP requests/responses that
We have installed Apache 2.2 on a windows server 2003. We want to make
I want to make this url redirect using .htaccess (linux/apache) .. I want to
I want to make DataSource in Spring through JNDI. All the configuration are given.

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.