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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:47:33+00:00 2026-06-03T01:47:33+00:00

So I have an apache server with subdomains with subdirectories. I turn my directories

  • 0

So I have an apache server with subdomains with subdirectories. I turn my directories into subdomains. So instead of example.site.com/mycoolsite it’s mycoolsite.example.com. Or in other words I turn /var/www/mycoolsite into /var/mycoolsite. I do this with the .htaccess file with the below code.

RewriteCond %{HTTP_HOST} ^mycoolsite.site.com$ [NC]
RewriteCond %{REQUEST_URI} !^/mycoolsite/
RewriteRule ^(.*)$ /mycoolsite/$1 [L]

Great. Now it turns the directory into the subdomain. The problem now is that .htaccess can’t reference the ErrorDocument I setup for my original subdomain. I can go to example.site.com/mycoolsite/aNonExistantDirectory/ and get the proper 404 I have setup, but when I try mycoolsite.site.com/aNonExistantDirectory/ I get the basic server 404 error page, not the one I have setup. Both are on the same server. To get around the problem, I can make a copy of the error documents and put them inside the /mycoolsite/ directory but I’m hoping I can simply reference the original error documents.

The problem is, I don’t know how to reference the error documents in /var/www/error/ to /var/www/mycoolsite/ I’ve tried:

ErrorDocument 404 ../error/index.php?p=404
ErrorDocument 404 /www/error/index.php?p=404
ErrorDocument 404 www/error/index.php?p=404
ErrorDocument 404 error/index.php?p=404
ErrorDocument 404 /error/index.php?p=404

None of those work. When try it without the first / or preceding .. it will display the error document line on the page. I’m stumped. I hope I included enough information, but if not, let me know.

  • 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-03T01:47:34+00:00Added an answer on June 3, 2026 at 1:47 am

    I don’t think apache lets you reference files outside of the current document_root. It’s a security thing. What you can do is create a dummy php file that just contains a include(../error/index.php)

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

Sidebar

Related Questions

I have the domain example.com and the test.example.com running on apache server. For some
I'm running a site on an apache server named www.example.com which has sub.example.com subdomain.
I have apache/PHP - WINDOWS server. I have 2 different sites (www.example.com and test.example.com)
I have a concrete5 site that works 'out of the box' in apache server.
I have a website website1.com on Apache server developed using PHP and deployed in
I installed XAMPP and have an apache server running. My files are located on
I'm trying to add Apache server to Eclipse(Juno). I have installed Apache server 7.0,
I have my Apache http server running on localhost:80 and restlet server on localhost:8182,
I have installed apache on my server however I can not browse my website
I have a static Web project added to an Apache server. Whenever I make

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.