3

I have a K2 item with alias junior-tennis2. This item should display at http://www.melvilletenniscentre.com.au/junior-tennis2

However, this URL is being 302 redirected to http://www.melvilletenniscentre.com.au/404, which has a redirect loop.

I've double checked the K2 item's alias, and the menu entry alias, and they're both junior-tennis2.

There is nothing in .htaccess redirecting this URL to 404.

Why isn't this URL loading correctly? Thanks.

Joomla: v2.5.17

K2: v2.6.7

2
  • are you using any SEF extension?
    – FFrewin
    Commented Jul 13, 2014 at 9:08
  • Hi @FFrewin, we are not using any SEF extension, just Joomla's default SEF URLs.
    – Steve
    Commented Jul 15, 2014 at 13:43

3 Answers 3

2

Check your trashed and unpublished k2 items for a duplicate alias.

We had this problem once because there were to k2 items with the same alias and one of them was trashed. It was a fluke that it happened that way (totally my fault), Joomla! should prevent you from doubling up aliases, even in k2 items, but it caused exactly what you're describing.

2
  • Thanks Faye. I checked the trash and there were no duplicates.
    – Steve
    Commented Jul 8, 2014 at 7:14
  • Worth a shot! Sorry it didn't help.
    – Faye
    Commented Jul 8, 2014 at 16:03
2

Here goes nothing....

First this may not be an answer, its just a chain of thought that might help isolate the actual issue, by the looks of it without admin access it would be hard to dive deeper.

First it is redirecting to 404 because it thinks the page is not there. However 404 is also not there, so it tries to redirect to the 404 page, and you can see where the redirect loop starts.

So I am guessing you have no menu item for the 404? Try to add one and point it to some article and see if that helps the redirect loop (for starters).

Then take that menu item and grab the id. After that go to http://www.melvilletenniscentre.com.au/index.php?Itemid=MENU_ITEM_ID

Does the page show up?

If so then most likely your htaccess file is not working, or you do not have the global configuration for rewrites created properly (or something with SEF). My best guess is the htaccess file, replace it with a brand new joomla installs version. For the global configuration, check the "site" tab. The settings you are looking for is Search Engine Friendly URLs and Use URL rewriting.

If not then it is a more serious problem, this is the baseline for how the menu manager works, so I would attempt to update Joomla to see if that helps, sometimes the newer files can fix issues (though I find that unlikely).

For the 404 page, something in your website is telling 404 pages to redirect there. There are a lot of things that can do that, but my guess is possibly the template error.php file. This file is meant to handle 404's.

if ($this->error->getCode() == '404') {
header('Location: '.JRoute::_('index.php?Itemid=156'));
exit;
}

This is an example of what you might see there, although possibly different, using Itemid like above would avoid the redirect loop, most likely yours would be going to /404 instead without using JRoute to define a menu item (this way even changing the alias will still redirect properly).

EDIT:

I have looked at that new 404 page, there is an error in your templates error.php

Fatal error: Cannot access protected property JException::$message in /home/USER/public_html/DOMAIN/templates/TEMPLATE/error.php on line 52

Take a look at line 52 there and see if there is anything that can be done there. Without seeing it I cannot really help with the exact cause but most likely you could remove that portion without much problems.

The page still reads a 404, meaning the record in question cannot be found and it has given me another thought, what is the publish dates? you can set a start publishing and and end publishing date, if they are set it could be triggering the 404. They can be found in the k2 item.

6
  • I resolved the 404 loop issue. We have Search Engine Friendly URLs and Use URL rewriting both turned on. We are not using a SEF extension.
    – Steve
    Commented Jul 15, 2014 at 13:43
  • If I load /index.php?Itemid=156 I receive a proper 404.
    – Steve
    Commented Jul 15, 2014 at 13:46
  • That is quite weird then, loading the itemid directly should work, this makes me think something is wrong with your install of k2. Is this the only k2 menu item with an issue? If not then I would update/reinstall k2 (do not uninstall first, so that your data is not lost). Though I am sure you may of tried that but worth a shot. Commented Jul 15, 2014 at 16:46
  • There is only 1 other K2 item that doesn't load. The rest do.
    – Steve
    Commented Jul 17, 2014 at 3:23
  • Maybe, as my last suggestion, refer to REactionFaye's answer but for menu items rather then k2, look for trashed/unpublished menu items that maybe have the same alias. Commented Jul 17, 2014 at 16:56
1

A few suggestions:

If you are using any SEF extension, check in its url and 404error manager to see any entries related to this item/page.

Also, it might worth checking in the Joomla Redirect component if something is going on there in case you have it enabled.

Finally, you could totally remove that item from the database and recreate it and re-link it with a new menu item, but first make sure you have remove from everywhere any references to this url - especially if you are using any SEF extension or the Redirect component.

Ahh... and before checking again in the front-end - do clear all caches in Joomla and in the browser and refresh the page.

3
  • I've tried deleting the items and recreating them, but this did not work FFrewin.
    – Steve
    Commented Jul 15, 2014 at 13:47
  • Have you also checked in the Joomla redirect component? - Try to disable the redirect plugin. And what about using a different alias for the item, like /junior-tennis. Also check with the Joomla SEF / Rewrite to off, although I guess this should work...
    – FFrewin
    Commented Jul 15, 2014 at 14:10
  • There is no Joomla redirect component. I have tried using a different alias, without success. I turned SEF/rewrite off, and the issue remained.
    – Steve
    Commented Jul 20, 2014 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.