Custom 404 Page

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
bearsharktopus
Registered User
Posts: 11
Joined: Sat Nov 16, 2019 8:15 pm

Re: Custom 404 Page

Post by bearsharktopus » Sun Nov 17, 2019 7:17 pm

Tastenplayer wrote:
Sun Nov 17, 2019 7:10 pm
@bearsharktopus
This picture comes to me sometimes(Not Found....) - this seems to be due to the server configuration. I think that you would have to insert another image on the server.
If I enter a page in the forum, which does not exist, comes always: no route found for....
I'm unsure as to what you are trying to tell me, apologies.

User avatar
Tastenplayer
Registered User
Posts: 409
Joined: Thu Jul 03, 2014 9:20 pm
Location: Switzerland
Name: Jutta Koliofotis
Contact:

Re: Custom 404 Page

Post by Tastenplayer » Sun Nov 17, 2019 7:38 pm

Image
This image is the default image of your server. If a page in my forum is not accessible, it sometimes happens to me. This seems to be due to the server settings, on which I unfortunately do not have much influence, that sometimes that comes instead of the message in the forum. That's what I meant.
You can change this, too, if your server allows its own .htaccess (unfortunately not every entry in the .htaccess is allowed by my server):

https://www.instructables.com/id/Add-a- ... your-site/
My phpBB Style Board & More3.3.0-b2 StyleTBChristmas calendar (Changing style background & song in announcement)
Be the best version of yourself rather than a bad copy of someone else!
Excuse me for my English, but I learned the language by speaking to people and not at school.

User avatar
EA117
Registered User
Posts: 1155
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Custom 404 Page

Post by EA117 » Sun Nov 17, 2019 7:51 pm

bearsharktopus wrote:
Sun Nov 17, 2019 7:02 pm
https://forum.homestuck.xyz
Agreeing again with Lumpy, and the error page I see when hitting your site with an invalid path like https://forum.homestuck.xyz/404 shows the web server's 404 page, instead of phpBB's "The requested page could not be found" message. So you can just set aside that previous in-depth reply for now, because it's not what's happening on your site yet... 😜

Since your HTTP responses suggest an Apache web server, the .htaccess file at the root of the phpBB installation (the same directory where phpBB's config.php exists) is what should have caused the attempt to access this invalid path to be routed through phpBB's app.php. Like if we do the same thing here on https://www.phpbb.com/community/404.

So for the situation you're literally in right now, using your hosting provider's instructions for how they support adding custom 404 error pages (or simply creating those error page references in the .htaccess file yourself) is how you could make a more customized error page. i.e. You're not getting any of that phpBB-specific behavior we were expecting.

But in order to make phpBB work the way it was intended, and/or the way you might require it to work with some future extensions, you should probably investigate and fix why phpBB's recommended and included .htaccess rules are not in effect already. At which point you will be in the position of "now do I want to customize The requested page could not be found page that phpBB shows."

If you're not sure why phpBB's .htaccess isn't already in effect, perhaps just post the contents of your current .htaccess file (the one in the same directory as phpBB's config.php) between two [code][/code] tags here. It may be that some additional rules added to that file have inadvertently caused the phpBB default rules to become skipped, or similar.

bearsharktopus
Registered User
Posts: 11
Joined: Sat Nov 16, 2019 8:15 pm

Re: Custom 404 Page

Post by bearsharktopus » Sun Nov 17, 2019 7:57 pm

EA117 wrote:
Sun Nov 17, 2019 7:51 pm
bearsharktopus wrote:
Sun Nov 17, 2019 7:02 pm
https://forum.homestuck.xyz
-snip-
As mentioned in my first post, I don't think I have an .htaccess file in my server. I've searched pretty thoroughly and come up with nothing.

User avatar
EA117
Registered User
Posts: 1155
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Custom 404 Page

Post by EA117 » Sun Nov 17, 2019 8:30 pm

bearsharktopus wrote:
Sun Nov 17, 2019 7:57 pm
bearsharktopus wrote:
Sat Nov 16, 2019 8:19 pm
All I need is a page that displays a 404 image that I have, and that's it. I know I have to muck about in .htaccess, but I don't know where to find that or if it exists on my server.
As mentioned in my first post, I don't think I have an .htaccess file in my server. I've searched pretty thoroughly and come up with nothing.
Got it. Well to put the phpBB-supplied .htaccess file into place -- which is what phpBB would recommend, of course -- you would download the current phpBB full package, extract that .zip file to a local directory, and then upload only the .htaccess file from those extracted files. You upload it using FTP, into the same folder where phpBB's config.php exists on your site.

If during the FTP attempt you're prompted to confirm overwriting, stop and cancel the upload attempt. Since this implies there actually is an .htaccess file present there which possibly is being hidden from you. You likely want to find out what's in that current .htaccess file before allowing it to be overwritten.

Once successfully uploaded, at that point its expected an invalid page URL should begin redirecting to the phpBB-specific "The requested page could not be found" page.

bearsharktopus
Registered User
Posts: 11
Joined: Sat Nov 16, 2019 8:15 pm

Re: Custom 404 Page

Post by bearsharktopus » Sun Nov 17, 2019 8:51 pm

Downloaded it, grabbed .htaccess, put it into the server, and... Nothing. Reloaded apache2 and still nothing.

User avatar
Tastenplayer
Registered User
Posts: 409
Joined: Thu Jul 03, 2014 9:20 pm
Location: Switzerland
Name: Jutta Koliofotis
Contact:

Re: Custom 404 Page

Post by Tastenplayer » Sun Nov 17, 2019 9:14 pm

In my account such a change on my server sometimes takes up to one day! For whatever reason.

Unfortunately not all configurations of the .htaccess on my server work either. Often I have to try several different insert versions from the net until something works. It seems my provider's extreme security measures are to blame.
My phpBB Style Board & More3.3.0-b2 StyleTBChristmas calendar (Changing style background & song in announcement)
Be the best version of yourself rather than a bad copy of someone else!
Excuse me for my English, but I learned the language by speaking to people and not at school.

User avatar
EA117
Registered User
Posts: 1155
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Custom 404 Page

Post by EA117 » Sun Nov 17, 2019 11:05 pm

bearsharktopus wrote:
Sun Nov 17, 2019 8:51 pm
Downloaded it, grabbed .htaccess, put it into the server, and... Nothing. Reloaded apache2 and still nothing.
Fair enough; it looks like this hosting provider may simply not have .htaccess overrides allowed at all by default.

Whether that's actually what's stopping it in your case, or whether they might have some more specific configuration you'll need to add in order to enable directory-level control, these are things perhaps only your hosting support can answer. You could check whether the configuration exists, but if the .conf file location doesn't match this description, or if the described configuration already exists, then you'll probably just need to talk to your hosting support about what's required for enabling .htaccess control.

bearsharktopus
Registered User
Posts: 11
Joined: Sat Nov 16, 2019 8:15 pm

Re: Custom 404 Page

Post by bearsharktopus » Sun Nov 17, 2019 11:28 pm

Gave that a shot, and let's hope it works.

EDIT: hell yeah

Post Reply

Return to “phpBB Custom Coding”