Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Redirects to Forums

    i have a gateway page on my server that has a picture. when i click on the picture while testing my site offline, it goes straight to the website. however, after i uploaded it to the server, clicking the picture goes straight to the forums.

    strangely enough, the address bar still reads home.php (the intended page). after messing around a bit with home.php's code, i noticed that removing the line $user->setup(); seems to solve the redirect problem. unfortunately it seems to screw up a lot of the code that relies on proper PHPBB cookie management.

    this didn't happen when i uploaded the forums directory directly from my hard disk, but after i did a clean install of PHPBB (using the automated PHPBB installation process instead of manually copying the folders) this problem appeared.

  • #2
    Regular Coder
    Join Date
    Dec 2007
    Posts
    137
    Thanks
    1
    Thanked 21 Times in 21 Posts
    If you can track down exactly what php line is outputting the URL for your image <a href> tag, then that's a step in figuring things out.

    Maybe there is a PHPBB configuration setting/file on your remote server that you need to change? that setting or file is probably different than your local machine, so that is maybe why it is going to a different URL.

    Or you could just hack the gateway page, like you attempted and hardcode the URL for your image link. Maybe paste the relevant PHP code in your gateway page here.

  • #3
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    PROBLEM SOLVED!
    It seems that line of code i'd stated was causing the site to redirect isn't actually necessary for proper cookie management. the content was broken because i hadn't properly edited the file with MySQL database/user/host variables to match the new database's.

    the gateway page is actually written in pure HTML, it has an image linked to the main site (home.php).

    the problem seems to lie in home.php's PHP code, specifically in the lines of PHP i copy/pasted for PHPBB cookie management:

    Code:
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forums/';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    when i remove $user->setup(); from the code then home.php actually loads. unfortunately, a lot of the site's content which is dependent on PHPBB cookie management gets broken. if i keep that line in, however, the site automatically redirects to my forums.
    Last edited by OMMad; 11-20-2010 at 09:27 AM.

  • #4
    Regular Coder
    Join Date
    Dec 2007
    Posts
    137
    Thanks
    1
    Thanked 21 Times in 21 Posts
    Glad you got it working and thanks for posting your solution. It may help others in the future.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •