Hi,
Apologies if this has already been incorporated in .8x, or mentioned elsewhere but my quick search didn't reveal much...
Since moving my site I've become much more aware of search engines. Anyway, the core modules don't return 404's for pages that are removed, they just return a normal page with some error text saying the item couldn't be found. Not much god for bots.
An easy fix which I've implemented for my site across core/custom modules I've written is a pn404 function. This ensures a consistent error page is generated across modules with the all important 404 header. Search engines will now remove the old pages from their index.
The function I wrote allows the module to specify the type of item missing, e.g. download, web link, article etc. And to provide some additional useful links, e.g. download main page, download module search etc. I'm sure you guys can do much better (if you haven't already!)
Cheers!
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
- nestormateo responded to »Fillters in Clip« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Suggestion - 404's
-
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 418
I agree. When content is nolonger used, as in deleted, or a user doesn't have the rights to access a part of a module. There aren't any httpheaders send. Far as I seen only the admin.php handles the httpheaders correctly.
.
In other modules you just see lines like:
Code
if (!pnSecAuthAction(0, 'Members_List::', '::', ACCESS_READ)) {
return pnVarPrepHTMLDisplay(_MODULENOAUTH);
}
if (!pnSecAuthAction(0, 'Downloads::Add', '::', ACCESS_ADD))
{
return errorpage(__file__,__line__,_DL_MODULENOAUTH );
}
if (!pnSecAuthAction(0, 'Topics::', '::', ACCESS_OVERVIEW)) {
echo _TOPICSNOAUTH;
include 'footer.php';
return;
}
if (!defined('LOADED_AS_MODULE')) {
die ("You can't access this file directly...");
}
.
No authorization should always give a 403, and on module $mod not available should always give a 404.
.
There should be an error module that handles these issues and send the correct http-headers along with the error.
.
Same goes for the 'problem with connection to the database'-error, and the 'site has been turned off'-error should be a 5xx header send.
.
Search engines seems to update and doing the indy 500 on my site in the first week of a month, and somehow my mysql seems to be having a vacation, which means all pages will be reindexed stating an error.
.
In .8 there's an Errors-system, but since i don't want to spend much time on the ms2 release, i haven't checked it out totally yet. But I hope this system will deal with all errors on module handling when content isn't there and/or there's an access denied.
.
Hope .8 will be bugless and stable soon, there are many things in .7 that could be so much better. -
- Rank: Team Member
- Registered: Jan 05, 2003
- Last visit: May 28, 2010
- Posts: 775
Quote
No authorization should always give a 403, and on module $mod not available should always give a 404.
A lot of changes have gone into 0.8 lately to accomplish such things. This has been integrated into the new Status/Error message framework and should work well. The implementation for module authors is IMHO about as easy as it can get.
Quote
Same goes for the 'problem with connection to the database'-error, and the 'site has been turned off'-error should be a 5xx header send.
Don't think that has been done yet, but it's a good suggestion. Chances are Mark will pick this one up when he sees this thread.
Quote
Hope .8 will be bugless and stable soon, there are many things in .7 that could be so much better.
I agree on .7 not being optimal. I am 100% convinced that 0.8 will be better, faster, more flexible. It won't be bugless (no software ever is) but it should be significantly better than .7.
Greetings
R -
**unknown user**
- Rank: Freshman
- Registered: Mar 16, 2002
- Last visit: Jul 22, 2008
- Posts: 53
Ah okay that's good to hear.
I hadn't considered the DB error. Good idea!
.8x sounds like it should be fantastic, but it's going to be a lot of work to setup since I now have over 100 modifications to the core of .76x to make things run how I want. It'll be fun working out which modifications I'll need to make and which you guys and have implemented!
(Off topic: but will we be able to run legacy modules such as the old download module? I made an API compliant, templated user interface for the old module to simplify the layout and improve the functionality (file type icons etc etc). I'll either have to write the admin half to have a complete module, or tie it into the new module. I'm not looking forward to either!) -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
All,
I've updated SVN to send a 503 Service Unavailable response when the site off feature is enabled. The new error generated code allows a module developer to use something like the following - in this case there will not only be an error triggered but a 403 response code will be sent too.
Code
return LogUtil::registerError(_MODULENOAUTH, 403);
-Mark
--
Visit My homepage and Zikula themes. -
**unknown user**
- Rank: Softmore
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 418
I edited the templates of the default error messages in .7.x, and add the 503's myself:
Code
Then I turned off MySQL, and looked at the headers that were send. Which returns:I'm wondering if that'll be enough. Because 404's return a '404 Not Found' and not a '404 ok'.Quote
HTTP/1.x 503 OK
.
Is this little edit I made enough to avoid SE's from re-indexing the error, instead of returning another time ?
- Moderated by:
- Support
