I added the line to my .htaccess and created my page but it’s not functioning.
"ErrorDocument 404 /404.html"
Is there an issue? Am I missing something? I have spent over 2 hours googling and reading every page I can on the subject but I haven’t found an answer.
Thanks, Carl
-
☆ A M B ☆
- 3,141 Posts
MODx serves its own 404 page (the resource specified in the system settings) when it can’t find a resource.
This works as all requests are send to the index.php file with the &q parameter set to the alias. MODx finds the corresponding page in the database/cache. If it can’t find anything, it loads the page not found resource as set in the system settings and displays that instead. (and puts a 404 header response)
So the short story is: don’t set it. MODx should do that for you already.
Thanks for the (I must say speedy) response.
Can I modify this page to reflect the rest of my site? I haven’t found any answers in the documentation, maybe I am not asking the right questions to find the right answers.
Thanks for the info, it’s a great start to understanding this.
Carl
I think I found it in System Settings. Error Page . . . .
Thanks Again
-
MODX Staff
- 12,272 Posts
Just adjust the system setting to point to any ID in your Resource Tree. You can then use any Snippets or anything you wish on your custom 404 page, like a sitemap, search, etc.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Thanks people, you pointed me in the right direction.
I have been a designer for 15 years on and off and this is my first time with a CMS. I toyed with some others but this is like a hot knofe through butter compared to others I tried. I guess because it’s new(ish)it’s hard finding the answers to some problems but I am enjoying the journey.
I may be heading in the wrong direction, but I'm working on a way to use Categories in Articles. I know it's on the roadmap, but for now I'm trying to find a temporary solution. My goal is to create category pages that list Articles from multiple ArticleContainers that are of that category (defined by a TV dropdown).
Obviously it would be nice to do this without having to create actual resources, so I'm wondering what if cleverly serving these category pages based on the URL is the way to go
jpdevries
Hello there,
I'm being asked to hard-redirect to a 404 page, not soft 404.
Something like this:
http://www.cancerplans.com/kdjakjlas will redirect you to
http://www.cancerplans.com/404
How can I achieve this with MODX evolution?
Thanks,
Hieu
-
MODX Staff
- 2,502 Posts
Quote from: ndh611 at Nov 09, 2012, 08:44 PMHello there,
I'm being asked to hard-redirect to a 404 page, not soft 404.
Something like this: http://www.cancerplans.com/kdjakjlas will redirect you to http://www.cancerplans.com/404
How can I achieve this with MODX evolution?
Thanks,
Hieu
This probably could have had a new topic, however, could you explain what it is you need the redirect to the 404 URL for? If for Google Analytics, this can be resolved by including something like this in the GA code on your 404 page via a conditional (with PHx or a snippet):
_gaq.push(['_trackPageview', '/404/?page=' + document.location.pathname + document.location.search + '&from=' + document.referrer]);
If this doesn't help, please let me know.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
Hi smashingred,
I really appreciate that you answer my question.
I'm working in a project with a SEO guy for my client. The SEO guy insisted me to do the hard-redirect, after I made the normal 404 page (provided by MODX). Currently here it is:
http://blue-spirit.nl/asdasd
He said that hard 404 is better than soft 404 for Google Web Master Tool - and that now is causing me a lot of troubles
Do I have to tweak the core to achieve this?
Thanks,
Hieu