viewforum.php redirect

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Registered User
Posts: 25
Joined: Sat Aug 14, 2004 3:49 am
Location: LA, CA, USA

viewforum.php redirect

Post by mocap69 »

I looked on my popular page views from my ISP and there seems to be alot of views of this page:
The problem is they are getting the error: The forum you selected does not exist.
I believe they are getting this error because they are accessing this page outside of the forum directly
somehow. I would like to redirect them back to this page:
Any idea how to accomplish this task?

I found a possible solution but not sure if the solution is worse than the problem:
I changed this line in the viewforum.php:

Code: Select all

message_die(GENERAL_MESSAGE, 'Forum_not_exist');
to this:

Code: Select all

redirect(append_sid("index.$phpEx", true));
Will this work or cause bigger issues?
Talk to REAL NFL players on the LARGEST forum on the WEB!!
User avatar
Project Manager
Project Manager
Posts: 29278
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko

Re: viewforum.php redirect

Post by Marshalrusty »

When the viewforum page is accessed, it expects a forum id to be passed along via GET (viewforum.php?f=1). No links in phpBB go to viewforum.php without passing a forum id. Your host's control panel probably just removes the id from the end of the URI.

Your change to the code is fine, assuming that's the way you want it to behave.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

Return to “2.0.x Support Forum”