Hey,
For some reason outdated urls like www.blueskyholidays.net.au/index.php?option=com_estateagent&act=object&task=showEO&id=1aren’t coming up with the error page like they should. I’m using friendly urls. Is there a way to fix this because I think it is messing with my stats?
Thanks,
Michael
It would seem like you solved it given that I landed on the error page when I clicked your link, probably didn’t set the error page (defaults to the home page @install), am I wrong ?
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
-
MODX Staff
- 10,725 Posts
The fact that the URL is to index.php means MODx is handling the link, and the fact that id=1 is included in that URL means that MODx interprets this as a request for the document with id = 1. So in fact, this URL is a valid MODx URL which explains why the error page would not be displayed.
Yes I have set the error page. It sounds like what OpenGeek said is right, is there anyway to avoid it or is it just a fact of life?
Sorry I didn’t notice the id=1 in the query string... If I understand correctly you’d like to get an error page if one or several of the parameters in the query string is incorrect ?
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Yes Basically what happened was the site used to use joomla until I recently redeveloped it to use MODx. I’ve been using Goggle Analytics since the change and have been trying to work out if there are any out of date links. I’ve been scratching my head as to how the out of date links have been getting so many hits and now think that maybe Google Analytics sees the old joomla links that happen to have id=* in them as the page id they correspond to in modx. So I guess I need a way to filter out pages so that if they contain the option=com_estateagent in the url then it returns the error page. Is that even possible?
If your problem is to redirect cleanly the old URLs to the new, then I suggest you give a look at the
Missing plugin. It might be way less complex, but if you have lots of URLs to "map" then it could be time consuming...
Description
When you redesign or migrate a site to ModX, it is possible that URLs will change.
This is not good for existing links to the site or search engines.
This plugin will redirect to an appropriate new page that you specify for any old URLs
Instructions
* Create a new plugin, and paste in the contents of the file
* On the plugin "System Events" tab, check the "OnPageNotFound" box
* Edit the $redirect array, with your old URLs, and the ModX page ID they should redirect to
* Save and test
e.g.
$redirect = array(
’about.asp’ => 74,
’healthcare.asp’ => 28,
’transport.asp’=> 27
);
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I’ve tested it on a staging server and it doesn’t work because it is a technically valid address because it contains id=1 and because of this it doesn’t return a 404
-
MODX Staff
- 10,725 Posts
Use a plugin attached to the OnWebPageInit to call $modx->sendErrorPage() to get a MODx error_page without, and without hacking index.php, or use similar RewriteConditions and a RewriteRule to send those requests where ever you want.