Getting a 404 error for viewtopic.php on all topics but file exists.

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
croft3r
Registered User
Posts: 4
Joined: Sat Jun 16, 2018 7:48 pm

Getting a 404 error for viewtopic.php on all topics but file exists.

Post by croft3r »

Hello, I am getting a strange error with my forums: https://forums.minewarsgaming.com/

On my forums I currently have two test topics created in our General Discussion forum. One created by a "Newly Registered User" then approved by a moderator and one created by an admin. However, when I visit both of these topics I am met with the following error "The requested page could not be found." Checking dev tools reveals I am receiving a 404 error for "viewtopic.php:1". This is repeated by me, a few other friends, and rather or not a user is a guest or has write permission. However, viewtopic.php is on my web server.

I am very new to this so please forgive me if I am missing a very obvious configuration step.

Here are some of my server statistics if that helps anything:
Board Version: 3.2.2
PHP Version: 5.6.35
Database: MySQL 5.5.59 MariaDB
Hosted by: Rackcrate (Dedicated hosting company. Typically does not provide configuration support, only support for the dedicated machine.)
Hosting Software: cPanel
Installed by: Softaculous phpbb installer for cPanel


Here are a few things I have tried with no luck:
Purging cache
Trying different client machines
Trying different browser
Modifying Cookie secure (Turning SSL on and off)


Anyways, thank you for the help in advance. I am currently not in a rush since I do not plan to start pushing our forums until the end of the month at the earliest, so I have some time to work on things. Also, if it comes down to it, I can do a full reinstall. Other than the theme I made (based off proflat) I have no data on this forum I care about yet so I am willing to try anything right now and I have already backed the theme up.

Currently, my only ideas are that it is possible part of the file could be missing. From what I have read on the forums it looks like the general consensuses is to never use script installers like the one provided by cPanel. Or it could possibly be some sort of security measure in place preventing the forums from working, like file permissions or something along the lines of that, maybe I have the wrong permissions set at the file level?

Thank you for taking the time to read my long post and thank you for your assistance, I look forward to a reply.
User avatar
janus_zonstraal
Registered User
Posts: 6414
Joined: Sat Aug 30, 2014 1:30 pm

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by janus_zonstraal »

I think the best thing is to start al over with the files from this site.

Is there a reason that you remove the phpbb copy write from the footer?
Sorry! My English is bat ;) !!!
croft3r
Registered User
Posts: 4
Joined: Sat Jun 16, 2018 7:48 pm

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by croft3r »

I will try a clean install. I actually didn't notice I removed the copyright. Looks like my parent theme has just a simple short code to integrate it in the footer area and it seems I removed that when I cleared the default footer. I didn't intend to remove it, just never noticed that I did. I will keep it on the next install. However, is it part of the requirements that I keep it? Again, no problem if I do need to keep it and even if it isn't a requirement I will likely keep it anyways.


I will do a clean install when I get the chance and report back.
croft3r
Registered User
Posts: 4
Joined: Sat Jun 16, 2018 7:48 pm

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by croft3r »

Well, I just completed my reinstall and without making any changes I just went straight to the default forum and topic generated. However, I am still getting this error.

Any ideas on what could cause this to persist over a clean install? This time I did a fully manual install. I did not use any install scripts this time. I also made sure to download the latest version from this website. Could it be something to do with my PHP version? (5.6.35)

Is there a more advanced debug option I can display instead of using dev tools in Chrome? Maybe we can figure out what is preventing this from working properly.

Thanks,
Croft3r
croft3r
Registered User
Posts: 4
Joined: Sat Jun 16, 2018 7:48 pm

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by croft3r »

Well, just heard back from my server host and it looks like ModSecurity in cPanel is blocking this php file from operating properly. As a work around I can disable ModSecurity on the forums domain and maybe look at tracking down which rule is causing this file to malfunction.

I would love to see if other cPanel users with ModSecurity are experiencing this issue. If there is enough users, maybe the phpBB team can have a look at it and see if it is possible to rework some of the php code in that file to make it less likely to be caught as a false positive. Or possibly cPanel can make an exception? I am not really sure. Also, I am not much into php programming so this may not understand how difficulty it may be to do this.

Anyways, if I can figure out a way to disable individual rules for this domain I will report back on what I disabled as to help others in this situation. Otherwise, I will just have to disable ModSecurity for this domain.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by Lumpy Burgertushie »

this is something your host needs to fix. they have it set way too strict. you really have no control over this other than to possibly turn it off from your cpanel. I have never seen one set this strict that it will not allow normal php files to be executed. any way, contact your host support, ask for level two support since the ones that answer the phone or chat usually don't know anything that is not in the basic manual.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
EVO_VV
Registered User
Posts: 55
Joined: Tue Feb 13, 2018 3:11 pm

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by EVO_VV »

From what you have said it appears you have access to your server, this being the case :-
Find file modsec_audit.log and look in the entries in there to find the entry that is blocking the php file.
Within that entry you will see something like [id "960008"] - this is the ID of the rule that is doing the blocking.
Now find file global_disabled_rules.conf and add SecRuleRemoveById 960008 to it and save the file.
Obviously change the 960008 to the actual number you find in the offending rule.
Re-Start httpd so that the rule will be activated.

You will probably find there are a few other things for phpBB that get blocked by mod_security so when you find then repeat the above procedure.
However, there are some instances where it is better to not disable the rule and adjust the input to phpBB.
There are some common words that can appear in a Post or PM that will trigger mod_security.

Hope that helps.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26456
Joined: Fri Aug 29, 2008 9:49 am

Re: Getting a 404 error for viewtopic.php on all topics but file exists.

Post by Mick »

croft3r wrote: Sat Jun 16, 2018 8:14 pmModifying Cookie secure (Turning SSL on and off)
You cookie settings are correct.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Post Reply

Return to “[3.2.x] Support Forum”