Authentication else statement - possible?

Discussion in 'Apache' started by sarahk, Feb 15, 2011.

  1. #1
    I'm developing a new site for a client.

    We've got Domain A running the old site and Domain B running the new site. Office emails use Domain B (and therefore people may type Domain B into their browser).

    I'd like to use .htpasswd etc to lock down the contents of Domain B but for those who fail - I want them redirected to Domain A.

    How do I do this?
     
    sarahk, Feb 15, 2011 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,909
    Likes Received:
    4,555
    Best Answers:
    124
    Trophy Points:
    665
    #2
    Got a good enough solution. Added this
    ErrorDocument 401 "<html><head><meta http-equiv='refresh' content='0;url=http://www.domain-a.com/'></head><body><h2>Authorization Required</h2><h1>Redirecting you to http://www.domain-a.com/</h1></html>
    
    Code (markup):
     
    sarahk, Feb 15, 2011 IP