Custom 404 Page by Siropu

Custom 404 Page by Siropu 1.1.7

No permission to download

Siropu

Well-known member
Siropu submitted a new resource:

Custom 404 Page by Siropu - Customize your 404 error page, keep track of missing URLs and redirect them to new pages.

This add-on allows you to customize your 404 error page, keep track of missing URLs and redirect them to new pages.

It comes with a basic error message but you can customize the page the way you want it using HTML and XF template syntax, having the option to hide the header and the footer.

Log can be found in ACP > Tools > 404 not found

Read more about this resource...
 
It would be great if the xf1 four oh four addon can be upgraded to this one.
I'm sorry, I don't have any plans for that. What you can do is to add the missing columns and rename the columns of the old database to match the table of my add-on. After that, drop the new table and rename the old one.
Only request I have is to be able to sort by date, view count, and/or URL.
Sorting was planned but I forgot about it. :)
 
if you have a custom 4o4 page, change the phrase(text) "siropu_custom_404_page_title" to
<meta http-equiv="refresh" content="0; URL=https://your.tld/your-custom-error-pages/YourCustom404.html">
It might not be a good idea when it comes to SEO. You can paste the HTML code between the <body> tags of your custom 404 page in the admin option "404 page content" and add custom CSS with <xf:css>your CSS code here</xf:css>

Or you can paste the entire code in the SIROPU_CUSTOM_404_PAGE_CONTAINER template directly and check the admin option "Display content only".
 
When I try install the addon at my demo site, I get the following error message. Any idea please ?

XF\Db\Exception: xf_siropu_custom_404_page_not_found: MySQL query error [1214]: The used table type doesn't support FULLTEXT indexes
src/XF/Db/AbstractStatement.php:217

CREATE TABLE xf_siropu_custom_404_page_not_found (
entry_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
entry_date INT UNSIGNED NOT NULL DEFAULT '0',
url TEXT NOT NULL,
last_view_date INT UNSIGNED NOT NULL DEFAULT '0',
redirect_url TEXT NOT NULL,
view_count INT UNSIGNED NOT NULL DEFAULT '1',
PRIMARY KEY (entry_id),
FULLTEXT KEY url (url),
KEY entry_date (entry_date)
) ENGINE = INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1214, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1214, 'HY000')
#2 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/Schema/AbstractDdl.php(151): XF\Db\AbstractAdapter->query('CREATE TABLE `x...')
#4 src/XF/Db/SchemaManager.php(186): XF\Db\Schema\AbstractDdl->apply()
#5 src/addons/Siropu/Custom404Page/Setup.php(30): XF\Db\SchemaManager->createTable('xf_siropu_custo...', Object(Closure))
#6 src/XF/AddOn/StepRunnerInstallTrait.php(60): Siropu\Custom404Page\Setup->installStep1(Array)
#7 src/XF/AddOn/StepRunnerInstallTrait.php(27): Siropu\Custom404Page\Setup->installStepRunner(1, Array)
#8 src/XF/Admin/Controller/AddOn.php(398): Siropu\Custom404Page\Setup->install(Array)
#9 src/XF/Mvc/Dispatcher.php(321): XF\Admin\Controller\AddOn->actionInstall(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:AddOn', 'Install', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
#11 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\AddOn), NULL)
#12 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#14 src/XF.php(390): XF\App->run()
#15 admin.php(13): XF::runApp('XF\\Admin\\App')
#16 {main}
 

Attachments

  • Screenshot_2.webp
    Screenshot_2.webp
    76.9 KB · Views: 22
A minor suggestion: It would be more logical to put the log under the 'Logs' menu instead of the 'Tools' menu.

I concur.

Also, would it be possible to add an option whether to display the 404 logs in ascending or descending order? I think it makes more sense to display the latest entries first.

Anyhow, what a brilliant and much-needed add-on!
 
Last edited:
@Siropu this addon works great. I'm pretty happy with it. Thank you!

Please add sorting options so that we can quickly see the pages that are hit the most or the most recent. It would also be very handy to be able to filter the entries that have a redirect, because we only need to process the entries that have no redirect yet.
 
It would also be very handy to be able to filter the entries that have a redirect, because we only need to process the entries that have no redirect yet.
Unless I am misunderstanding, there is no need, because once there is a redirect then the those pages (previously 404) will no longer be showing as 404 entries. Unless you got the redirection wrong (in which case you still need them to show as 404)
 
@Siropu
i found 100reds of Links to redirect. thats too much to edit every link (add redirect) so need a regex for this. Can you help? ;

This:
post2068288.html

should be this...
post-2068288.html
 
 
Thanks for helping, but that dont work for me. This is no a postContent, its a Link comes from outside, from searchbots and old Links.
 
It would be more logical to put the log under the 'Logs' menu instead of the 'Tools' menu.
It is both a log and a tool. :)
Also, would it be possible to add an option whether to display the 404 logs in ascending or descending order?
Sorting was supposed to be added but I forgot about it.
Can you help?
In that case I suggest adding a .htaccess 301 redirect
Please send me a PM with your post URL structure and I will see if I can provide you a redirect rule.
 
thank you for the add-on

I have a suggestion .. when the missing link is redirect . must deleted from the list
 
Top Bottom