1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

401 redirect to another site

Discussion in 'Apache' started by sarahk, Jun 25, 2005.

  1. #1
    I'm protecting an entire site but if users don't have access I want them to go to the sister site.

    What do I need in .htaccess to do this?

    I tried having a local file called go.php which used headers to do the redirect but I got server errors because the user didn't have access to the file (because it too is protected!)

    thanks

    Sarah :)
     
    sarahk, Jun 25, 2005 IP
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    .htaccess
    
        ErrorDocument 401 http://www.sister-site.com/subscription_info.html
    
    Code (markup):
     
    exam, Jun 25, 2005 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #3
    Thanks exam...

    That's what I had but the server gives me this standard page...
     
    sarahk, Jun 25, 2005 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hmmm it should work, although I've never actually done it. the .htaccess file would need to be in the root directory of domain A and the 401 redirect would point to a page on domain B. This is what you have tried right? The only other thing I can think of is that you're not allowed to override the ErrorDocument directive in .htaccess Maybe you want to browse the apache docs? Here's the page on the ErrorDocument directive for 1.3
     
    exam, Jun 26, 2005 IP
  5. stymiee

    stymiee Peon

    Messages:
    427
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It's possible that your webhost doesn't support it. Are you on a shared host or your own server?
     
    stymiee, Jun 26, 2005 IP