WorryFree Computers   »   [go: up one dir, main page]

Editing The 404.php or Error Page

Hello, I would like to know if there is a 404.php or error.php file to edit because I had to 301 redirect in the site located in a folder to the main site domain.
No matter what code placing inside the folder site I get an error in Elgg.
This is the code:

<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>

RewriteEngine on
RewriteRule ^(.\*)$ https://www.mysite.com/$1 [L,R=301]   (that code is i the htacess file inside the the folder site).
The error message I get is located at the page   /view_page.php?pid=21

Egg  v3.3.25
The bottom line is that I'm ok with the error page, but I want to edit to place a link to the front page, is that possible?
Thank You.
 

  • Override these views:

    \vendor\elgg\elgg\views\default\errors\default.php
    
    \vendor\elgg\elgg\views\default\errors\404.php

     

  • I looked at those files and I couldn't edit it enough to put out a message with a link to the front page.
    However, I found the Message Error located at this address: elgg/languages/en.php
    Page not found and  
    The page you are trying to view does not exist or you do not have permissions to view it. "
     I can't change it because there is something stopping the change.
    If you know which pages are putting out those "sentences" and if they can be edited?
    Appreciate it.
    Thank You.

  • If you need a redirect when there's no page,  you can use your server configuration rules.


    If you want to customize error pages inside Elgg, use the previous my reply.

    I don’t want to look for Apache config now (which I hate), but I’m sure Google will help you.

    Here is the redirect configuration example for Nginx:

    location ~* /my-old-page { rewrite ^ https://mycoolsite.com/my-new-page; }

    Bonus linkhttps://htaccess.madewithlove.com/