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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:40:12+00:00 2026-06-06T23:40:12+00:00

I have a problem with redirect to protected folder. There are two domains: domain1.com

  • 0

I have a problem with redirect to protected folder. There are two domains: domain1.com & domain2.com
hosted in two different servers. Both have set in .htaccess rules that adds www to address:

RewriteCond %{HTTP_HOST} ^domain1\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^domain2\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]

and both have a folder /admin that is protected.

there is no problem when I want to access to this folder in this way:

- http://www.domain1.com/admin
- http://www.domain2.com/admin

but when I try to access them with those addresses:

- http://domain1.com/admin
- http://domain2.com/admin

only domain1.com works properly asking for password,
domain2.com returns 401 ERROR

--------------
--------------
root@vps:~# telnet domain1.com 80
Trying 1.1.1.1...
Connected to domain1.com.
Escape character is '^]'.
HEAD /admin HTTP/1.1
Host: domain1.com

HTTP/1.1 401 Authorization Required
Date: Fri, 29 Jun 2012 18:54:34 GMT
Content-Type: text/html
Connection: keep-alive
WWW-Authenticate: Basic realm="admin"
Accept-Ranges: bytes
Vary: Accept-Encoding
Server: Apache/2

Connection closed by foreign host.
--------------
--------------
root@vps:~# telnet domain2.com 80
Trying 2.2.2.2...
Connected to domain2.com.
Escape character is '^]'.
HEAD /admin HTTP/1.1
Host: domain2.com

HTTP/1.1 301 Moved Permanently
Date: Fri, 29 Jun 2012 18:52:19 GMT
Server: Apache/2
WWW-Authenticate: Basic realm="Panel Administracyjny"
Location: http://www.domain2.com/401.shtml
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.
--------------
--------------

What can be wrong how can it be fixed?
Is it possible that a line with Connection: keep-alive is missed if case of domain2.com? Admin of domain2.com said: it is not possible to make such redirection to protected folder – but you know -.- it is possible as you see with domain1.com — so I have to be sure before saying him what should be fixed.

  • 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-06T23:40:13+00:00Added an answer on June 6, 2026 at 11:40 pm

    ok, here is solution: domain1.com has disabled ErrorDocument 401 and that’s why this redirection works – unfortunately it seems that it’s not possible to make such redirection with enabled ErrorDocument 401.

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

Sidebar

Related Questions

I have a problem with php header redirect. I already spent hours trying to
I have a problem with validation messages not showing after a redirect, even when
I experience strange problem. We have error handling in global.asax that would redirect user
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I have the following problem in ASP.NET: there is a form that contains a
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have problem with show or hide form in Window Form Application. I start
I have problem with UIWebView delay when the load image from url. In my
I have problem while loading data into html select when users press or click

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.