1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

iframe code for what is essentially a masked redirect from a subfolder not a subdomai

Discussion in 'Hire a Freelancer' started by richjtf, Feb 14, 2016.

  1. richjtf

    richjtf Junior Member

    Joined:
    Oct 20, 2015
    Messages:
    184
    Likes Received:
    77
    Occupation:
    Being lost.
    Location:
    Venezuela.
    Hi, i've been trying to do this myself but my attempts all failed so far, i'm in need of a masked redirect that works this way:

    I want my site example.com to have a subfolder that redirects to another site, example:


    • example.com/my-post-subfolder should redirect to anothersite.com, i want to accomplish this with a masked redirect.

    Now i understand i can't do that directly as a redirect as apache blocks masked forwarders it for security reasons, so what's left for me is to use an iframe.

    I've tried to use do it on my own by using an iframe, placing both height and width at 100%, and the width is fine at 100% it changes in shape to fit the browser width size completely but the height at 100% for some reason represents 150px not full browser height (Read it is because the percentage represents the parent not the content?)

    I want the iframe to force the site to be displayed on the whole browser, basically a masked redirect. I think that is pretty simple to do for someone with good javascript skills, i want this code together with instructions on how to set it as a static page on my hosting provider so that i don't have to use wordpress and so that i can save resources on my server. I want another website to be displayed in full width and full height within the browser while the url featured is my sites.

    Please let me know your quote.
     
  2. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    974
    Likes Received:
    680
    Occupation:
    Web/Bot Developer
    Here you go:
    Code:
    <iframe src="https://site.com" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">
        Your browser doesn't support iframes
    </iframe>
    
     
    • Thanks Thanks x 1
  3. richjtf

    richjtf Junior Member

    Joined:
    Oct 20, 2015
    Messages:
    184
    Likes Received:
    77
    Occupation:
    Being lost.
    Location:
    Venezuela.
    I'm really thankful. How kind, seriously. Using it now. Thanks again.