![]() |
A 500 internal server error is returned when the user enters the wrong URL ending. Example: https://localhost/post/10001 where 10001 is not a valid post ID. URL's with valid post ID's work as expected. Any suggestions for an easy fix?
01-31-2024, 12:39 PM
(This post was last modified: 01-31-2024, 12:43 PM by captain-sensible. Edit Reason: extra extra )
for showing blog articles i use this route:
Code: $routes->get('blogArticle/(:segment)', 'Blog::showArticle/$1'); on a view page i foreach out a href with the following strucure Code: domain/blogArticle/slug-bit-of-text each blog has in database fields Id, bulkTexArticle, slug etc in controller I use Code: public function showArticle($theSlug) model bit is Code: public function getArticle($slug) Code: domain/blogArticle/slug-bit-of-text the slug-bit-of-text is checked to see if it exists , if it doesn't view is retured saying no such blog. In yours assuming 10001 is in your databse just see if there is such an entry if not return a view no such post. eg live this is a real blog article (daughter site) Code: https://andrinadesignstudio.com/blogArticle/Ghana-Adinkra-symbols try editing Ghana-Adinkra-symbols to something else in above url and see what happens
See logs, and know the cause.
https://codeigniter4.github.io/CodeIgnit...error-logs |
Welcome Guest, Not a member yet? Register Sign In |