Redirect iframe source to iframe page

Discussion in 'Apache' started by nicknick, Oct 10, 2008.

  1. #1
    Hi,

    Does anyone know how to use mod_rewrite to redirect the source of an iframe to the page containing the iframe? We need to do this because we're pulling an application from another server but don't want people to go to that server's URL.

    I tried using redirect 301 but the page keeps looping. I'm trying to use a rewrite condition with no luck. What I'd like is if the request comes from the page with the iframe, the rewrite rule doesn't apply. If it's from any other page, it should redirect to the page with the iframe.

    Thnak you :)
     
    nicknick, Oct 10, 2008 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't think there's any way to detect if the request is being made to fill an iframe or not in Apache.

    You would be better off using Javascript on the page that gets loaded into the iframe to detect whether it is in an iframe or not. If it isn't, it can just redirect to the iframe parent page.
     
    Ladadadada, Oct 14, 2008 IP