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.

rewrite the URL

Discussion in 'Apache' started by zerandib, Apr 5, 2009.

  1. #1
    Hello

    assume im getting a request(from another site) to my website like this;

    http://www.seperatesite.com/ext.php?ref=http://mysite.com
    (when this happens it will open mysite in a iframe)

    if some thing like that happens , i want to truncate(ignore) this part;
    http://www.seperatesite.com/ext.php?ref=

    and letting my site visible as normal.... simply i want to redirect to mysite.com -
    http://mysite.com

    please guide me ... how can i control such a thing using .htaccess


    thankx
     
    zerandib, Apr 5, 2009 IP
  2. RobsterUK

    RobsterUK Guest

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You seem to be saying that another site is loading yours in an iframe.

    Depending on what the other site is, perhaps you can ask them not to do this and link to your site properly.

    Otherwise I think your only alternative is to use a Meta Refresh to redirect the page to just the URL of your site, because I'm fairly certain that what you want to do isn't possible using .htaccess
     
    RobsterUK, Apr 5, 2009 IP
  3. megacontent

    megacontent Guest

    Messages:
    231
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use JavaScript I think. It's something like parent window = self. (Just paraphrasing). That will break you out of the frame.

    If, on the other hand, this is a redirect and your page is showing up like normal with just that URL then you can user javascript also. To window.location =
     
    megacontent, Apr 6, 2009 IP
  4. Steven_Reiz

    Steven_Reiz Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Your pages will have to break out of the iframe. Add this to the home page of http://mysite.com:

    <script type="text/javascript">
    function breakOut() {
    if (self != top)
    window.open("my URL","_top","");
    }
    </script>
    </HEAD>
    <BODY onLoad="breakOut()">

    (Courtesy of http://www.htmlhelp.com/faq/html/frames.html#stop-framing)
     
    Steven_Reiz, Apr 7, 2009 IP