Why does the redirect to page 404 in MODX not work? - modx

I have correctly configured the resource id in the "site" section in the system settings. But when I enter a mysite/ non-existentaddress in the browser, instead of a redirect to 404, a redirect to the main page occurs
I tried to add in my htacceess file redirect to 404, but it didn’t help

So your error_page system setting has published resource ID as desired 404 page, right?
What do you see here https://www.redirect-checker.org/index.php checking yoursite/non-existentaddress URL?
This setting should work without any htaccess additions, please comment them if any.
BTW how about friendly URLs, is it active now?

Related

404 Redirect or better option

I have the following code in my htaccess file to handle 404 codes:
ErrorDocument 404 https://www.mywebsite.co.uk/lost.php
RewriteEngine On
And of course a custom 404 page is returned (works fine).
I did a nibbler check and it said the following:
It is a common mistake to setup missing page handling by using a
redirect. The missing page should directly return a 404 error and not
redirect to another page.
This website does not return a 404 error HTTP status code for missing
pages. This is bad because search engines like Google might mistake
this for a real page of content.
What is the best practice to handle 404 error codes if the above is no good? I am just wanting something generic that is a catch all. No need to use a 301 because the point of my 404 is just to let visitors know that what they are looking for is not there or they have made a typo.
If it is a "common mistake" to to use a redirect how should it be done?
Thank you for any help.
You need to remove https:// or http:// from 404 handler otherwise it forces Apache to do a full redirect instead of internal rewrite.
So you can use:
ErrorDocument 404 /lost.php
It depends. If you have an application running on the webserver that takes in every URL coming in and has some logic implemented, that by itself has to figure out if the URL exists, then the application should directly return a 404 error page under the given URL and not redirect to another page like 404.html or so. But if your webserver handles the url requests with the .htaccess file then it is OK to setup a document that is returned in case of an invalid URL.

Using Joomla, htaccess won't forward pages without an extension to the correct 404 page?

At LTCperformance.com, I've created a custom 404 page. If the user types in ltcperformance.com/fakepage.html, it forwards to the 404 page. But if there's no extension (ltcperformance.com/fakepage), it simply shows a default system 404 page.
I'm controlling the 404 page using htaccess:
ErrorDocument 404 http://ltcperformance.com/404.php
ErrorDocument 403 http://ltcperformance.com/404.php
ErrorDocument 500 http://ltcperformance.com/404.php
I have URL Rewriting in Joomla Administrator = on
Also, in Joomla Administrator, the Adds Suffix to URL = off
Any ideas? I've gone through every answer I can find on other posts and nothing will bring up my custom 404 page if there isn't an extension on the file.
ADDITIONAL INFO:
Any non-existent pages go to the homepage when I do these settings:
- Search Engine Friendly URLs / NO
- Use URL rewriting /Yes
- Adds Suffix to URL /No
I have someone taking a look at it on the server side, but I don't know what server issue it is - everybody online says it's a server issue but the support can't pinpoint what the actual server issue is. It's Godaddy; I did set their 404 page settings (they have a separate place to put it) to my 404 page, but that didn't work either.
Joomla .htaccess routes all requests to the index.php in order to support SEF urls.
In case it can't route a page, it will load the templates' error.php page. You can edit that to your requirements, this will be the easiest.
Should the error.php not be included in your template, copy the one in /templates/system to your template folder and customize it.

Custom 404 error page generates 403

IIS 6.1 - Custom Error pages.
The web site is defined as www.url.com/mysite. Custom error pages have been defined for mysite. 404 and 500.100.
I can redirect to /mysite/500.htm and /mysite/400.htm.
I can set 500.100 to redirect to /global/500.htm and this works.
When I redirect 404 to /global/404.htm I get a 403 access denied error. (I also tried redirecting 404 to /global/500.htm just to make sure it was not file-specific rights.)
Directory browsing is enabled.
The page works if you browse directly to it.
Checked the iis log file for oddities.
Can anyone offer an explanation that might lead me in the right direction?

Google URL errors - soft 404s.

I've recently restructured my site and in the process have removed many pages.
I've put in .htaccess 301 redirects to reflect the changed structure where new pages directly replace old pages; have put in a custom 404 page and have included the following .htaccess command: ErrorDocument 404 /page-not-found.html.
For pages removed altogether that have no new equivalent page, I've used .htaccess to redirect to the 'page not found' custom page.
In webmaster tools, though, I'm seeing soft 404s reported - pages not found that are not returning 404 response codes.
Can anybody please advise a way forward on this?
Should I not redirect references to the deleted pages and let the 'pages not found' stack up in the webmaster tools report, or is there a way of returning a 404 code from the server for my deleted pages even though a redirect exists?
Any advice would be much appreciated.
Thanks,
Andrew
I think if the page doesn't have a new equivalent, then let it fall through not found, and return a 404 (which should show your custom page).
Google is showing a soft 404 because of the redirect (which is a 301, not a 404), as you say.
If you did redirect to the custom page, and somehow returned a 404, that's essentially the same thing as just letting them not be found.
The pages not found will stack up, but if they really aren't found anymore, then that's the correct response.
The alternative would be a 301 to a different page, that was a real "hey this moved, try this instead" page, but it would have to look like something other than "not found", to avoid google treating it as a soft 404.

magento homepage 404 status

OK...I am going crazy...
I have a Magento store in a /store/ directory. The homepage displays fine and users are able to make purchases, but to bots it's showing a 404 status code.
So /store/ and /store/index.php are both 404 header responses but I can navigate to those pages and browse the website from there. I've never seen this before.....blah
When I crawl the site with Xenu from the http://www.mywebsite.com/store/ URL it says it's 404 and the title shows, "redir" so I am assuming there is some redirect somewhere that I am missing(?)....
Any help is appreciated...I may need to explain this better so if so, I will gladly :)
Thanks in advance!
I appreciate all the help!
Somehow, changing the CMS page assigned as the homepage fixed the problem. The original homepage was calling some entity that returned a 404 error in turn giving a 404 error for the entire page.
Really not sure what happened...but like I said, changing the CMS homepage solved the problem!
Have you tried browsing your site with browser and a user agent switcher? There are examples of Magento being unable to build collections when the user agent is one of the bots which is explicitly left out of the log information.

Resources