Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author axew3

    (@axewww)

    Several possibilities both via JS or via php.
    One via JS can be:
    where on phpBB overall_footer.html (or on overall_header.html to redirect before the page load) you’ve add the code of the iframe resizer, just after the starting line
    <script type=”text/javascript”>
    you could add something like this:

    var BIndex = "{BOARD_URL}";
    if ( true === window.location.href.indexOf('index.php') > -1 || window.location.href.length == BIndex.length ){
     window.location.replace('http://www.mywebsite.com/wordpressIframe');
    }

    this will fire only in the case that the current URL contain index.php or the length of the called url length is exactly equal to the length of phpBB template var BOARD_URL, that we can assume can happen only in the case the page is main forum page because any other board url, will have more chars.
    The reason is that called url could be:
    http://www.mywebsite.com/index.php
    OR
    http://www.mywebsite.com

    One via Php could be in the wild:
    open phpBB root file index.php
    just after the starting tag
    <?php
    add the follow:

    header("Location: http://www.mywebsite.com/wordpressIframe"); /* Redirect browser */
    exit;

    Sure you want force this behavior if on board main url?
    cheers

    • This reply was modified 5 years, 8 months ago by axew3.
    Thread Starter nexusfred

    (@nexusfred)

    Thanks,

    I use a premium WordPress theme and I want to merge PHPBB into WordPress. To do so I had to remove some elements from the header and footer of PHPBB, so if someone call the forum from the PHPBB root folder, he will get a incomplete page without header, footer and sidebar. It’s will be ugly and not user friendly 🙂

    Best Regards
    Nexus

    Plugin Author axew3

    (@axewww)

    p.s
    i’m sorry that i often suggest on fly without properly test, but you will understand. I also often re-think to what i’ve do, while doing things of some other kind.

    About the above, not consider the php suggestion, because i imagine that the iframe isn’t loaded as needed in this way when after you’ll re-click or try to navigate the phpBB main index when on iframe. The code should be different to achieve the correct result.

    Consider instead to use the js code (also modified) wrapped in this way:

    <script type="text/javascript">
    if (!window.frameElement) {
    var BIndex = "{BOARD_URL}";
    if ( true === window.location.href.indexOf('index.php') > -1 || window.location.href.length == BIndex.length ){
     window.location.replace('http://www.mywebsite.com/wordpressIframe');
    }}
    </script>

    Put this into your overall_header.html just before the closing </head> tag
    recompile phpBB template
    cheers

    • This reply was modified 5 years, 8 months ago by axew3.
    Thread Starter nexusfred

    (@nexusfred)

    hello,
    I’m sorry for the delay.

    Thanks for the JS but that half work. 🙂

    My PHPBB url is http://www.mysebsite.com/myforum/

    My embedded PHPBB in a WordPress page url is http://www.mysebsite.com/forum/

    When I call the PHPBB url that produce a redirect to my WordPress url, but inside my WordPress page that produce an endless redirect 😉

    Best Regards
    Nexus

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect PHPBB default homepage to wordpress iframe’ is closed to new replies.