How to redirect dead links to a 404 Page

Permalink
How do I make it so that when a user goes to a deleted page it redirects to 404 page?

I followed the documentation herehttps://documentation.concrete5.org/tutorials/how-create-404-page-pa... .. and created a page_not_found.php file in the theme folder, but how do I make the redirection work because it's not working?

 
mnakalay replied on at Permalink Reply
mnakalay
Hello,

that tutorial you followed is not exactly to create a 404 page. Concrete5 already takes care of that. What that tutorial teaches you is how to implement your own 404 page with your own design and styling.

Normally, whenever a page s not found, Concrete5 should automatically take you to a "page not found" message page.

What is happening in your case?
tarekmostafa2 replied on at Permalink Reply 1 Attachment
In my case, if I go to a deleted page it first redirects me to the login page, then I log in and then I go to that page again, it redirects me to a page that says "Page Forbidden". I'll attach a screenshot of the page that shows up.
mnakalay replied on at Permalink Reply
mnakalay
I hate to point at the obvious but for your other problem with images not showing at certain resolutions, I said you had permission problems based on observation.

Now you have another unrelated issue that also seems to be pointing at permission problems...

Are you sure you don't have something seriously messed up with your permission? that can happen.

And are you sure you are logging in with the actual super user?

if it tells you the page is forbidden then it is not the super user
tarekmostafa2 replied on at Permalink Reply
I think you are right there might be something wrong in the custom code in the theme, but I'm very sure I'm logged in with the super admin credentials, and this page also shows up not only when I go to a deleted page but also when I intentionally go to any wrong URL
mnakalay replied on at Permalink Reply
mnakalay
permissions never ever apply to the superuser. You can't have a forbidden age if you're the superuser. try this, go to the members' page in the dashboard and click on the user under which you are logged in. Once on the user page check what the URL is in your address bar. If it ends with a 1 it SHOULD be the superuser.

But again it's not 100% full proof because having that 1 in the address bar and still not being allowed to access a page is not normal. That would point to something really fishy going on.
tarekmostafa2 replied on at Permalink Reply
Hi mnakalay,

I was able to solve this problem, I found that the page "page_not_found" was removed and it was placed under
/!trash/page_not_found
.. so I went to the phpmyadmin and renamed the file path to
/page_not_found


After that I went to the Single Pages under dashboard and refreshed the page to rebuild the persmission and name.

The problem now is the 404 page is only viewed when I'm logged in, but when I'm logged out it shows me a Service Unavailable error page.

You can see it if you visit >http://www.exrx.net/concrete/page_not_found...

You will see a Service unavailable, but when logged in the page is showing normally.
jean548 replied on at Permalink Reply