• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

278
Views
Apache ErrorDocument is not working When there is another Redirect rule

Here is my httpd.conf

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} localhost
RewriteRule (.*) https://google.com [R=301,C]
RewriteCond %{REMOTE_ADDR} !^192\.168\.134\.129
RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.8
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,C]
ErrorDocument 503 /maintenance.html
Header Set Cache-Control "max-age=0, no-store"
</IfModule>

First what im doing: a middleware server which in normal mode will redirect everything to main server (google.com for now) and will show a maintenance page, when in maintenance mode.

ErrorPage is working fine if i delete

RewriteCond %{HTTP_HOST} localhost
RewriteRule (.*) https://google.com [R=301,C]

so paths and everything should be ok

log gives me this Request exceeded the limit of 10 internal redirects due to probable configuration error.

I've tryed to use LimitInternalRecursion, but it didnt make any difference.

This is my first experience with web-servers, so i dont know what my problem is, please tell if there is an error somewhere in my rules, or if im doing everything wrong, thx.

almost 3 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error