[SOLVED] News 'more' link returns a 404 error

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

[SOLVED] News 'more' link returns a 404 error

Post by JimboDavies »

I am running CMS Made Simple 1.11.2.1 with News version 2.12.3.

The news Summary displays absolutely fine, however, clicking the 'More' link on any news item, returns a 404 error.

My news summary template (or one of them) looks like this:

Code: Select all

<div id="news">
<h2>Latest News</h2>
<ul class="newsticker">
{foreach from=$items item=entry}
<li>
{if $entry->summary}	{eval var=$entry->summary}
{else if $entry->content}{eval var=$entry->content}
{/if} 
{$entry->moreurl}
</li>
{/foreach}
</ul>
</div>
I am using pretty URLs, so the first part of my .htaccess file looks like this (I've removed some expires stuff etc as irrelevant to this query - if needed I can post the full .htaccess):

Code: Select all

  ErrorDocument 401 default
  ErrorDocument 403 default
  ErrorDocument 404 default
  ErrorDocument 500 default  
  Options +FollowSymLinks
  RewriteEngine on
  RewriteBase / 
  # 301 Redirect all requests that don't contain a dot or trailing slash to
  # include a trailing slash
  # except for form POSTS
  RewriteCond %{REQUEST_URI} !/$
  RewriteCond %{REQUEST_URI} !\.
  RewriteCond %{REQUEST_METHOD} !^POST$
  RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
 
  # Rewrites urls in the form of /parent/child/
  # but only rewrites if the requested URL is not a file or directory
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)$ index.php?page=$1 [QSA]

  # Sends requests for index.php to the site root
  Options +FollowSymLinks 
  RewriteCond %{REQUEST_METHOD} !^POST$
  RewriteCond %{THE_REQUEST} ^.*/index.php 
  RewriteRule ^(.*)index.php$ http://www.stormforce.biz/$1 [R=301,L] 
A sample error message would look like this:
Not Found

The requested URL /news/56/62/2011-12-Internship-Graduation.html was not found on this server.
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.stormforce.biz Port 80
Any thoughts on fixing this gratefully received - I suspect it's a mod_rewrite issue?
Last edited by JimboDavies on Wed Nov 07, 2012 3:23 pm, edited 2 times in total.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

I've only actually recently modified the Summary template to contain the words 'moreurl', it was previously 'morelink', as below:
<div id="news">
<h2>Latest News</h2>
<ul class="newsticker">
{foreach from=$items item=entry}
<li>
{if $entry->summary} {eval var=$entry->summary}
{else if $entry->content}{eval var=$entry->content}
{/if}
{$entry->morelink}
</li>
{/foreach}
</ul>
</div>
Neither morelink nor moreurl seemed to make any difference.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News 'more' link returns a 404 error

Post by calguy1000 »

There are two reasons you could have this issue:

A: your article is expired.
This typically happens when you're calling news in such a way that you want to view expired articles.
There is a toggle in the News module admin panel to change the behavior of this

B: Your detailpage is invalid.
You have a detailpage set in the News module admin panel, or you are calling news like {news detailpage=foo ...} and the destination page is inactive or no longer valid.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

Calguy,

Thanks for the damn speedy reply!

I can't find any toggle relating to the news items expiring in the 'options' section of the News module. The value in the box under 'The number of days (by default) before an article expires (if expiry is selected):' is set to 180, and News articles posted today are returning the 404 error - they're also not showing up as expired on the main news backend landing page.

I am calling the module as {news detailpage='news'... and have a page with the alias 'news'. It's hierarchy position is 2.1.1, as it is in a category called 'Information Pages' and then a child of 'About Us'. Should my detailpage='foo' make any allowance for the parents?

My full call of the news module (on this particular page) is:
{news detailpage='news' number='4' category='General,Sailing,Powerboating,Racing,Motor Cruising,Shorebased'}
Thanks,

Jimbo
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News 'more' link returns a 404 error

Post by calguy1000 »

The option is:

"Expired articles can be viewed in the detail view"

Near the bottom of the 'options' tab on the News module admin panel.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

Another thought - whenever we posted a news item, we used to define a url (starting with newsarticle/) in the relevant box (I think because if we didn't, we got 404 errors), however that box/option seems to have disappeared.

This is why I think it's possibly some dodgy mod_rewriting or similar on my part - I'm sure (and my memory is a little hazy!) that making the other users define a url for each news article was a workaround.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

calguy1000 wrote:The option is:

"Expired articles can be viewed in the detail view"

Near the bottom of the 'options' tab on the News module admin panel.
Ah. Unfortunately I don't seem to have that option, this is what I have at the bottom of the News module admin panel:
Image
I'm not sure that expiration is an issue though - because some articles have been posted today, and we do not tick 'use expiration date' on them either.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News 'more' link returns a 404 error

Post by calguy1000 »

I have a 'virgin' copy of 1.11.2 checked out and I can see the option for the news article url when editing an article. And see the option for displaying expired articles.

If you don't... you'll have to investigate what is different between your site and a stock install.

Also, if you're concerned about the .htaccess rules, try copying the docs/htaccess.txt to .htaccess (backup your file first).
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

calguy1000 wrote:I have a 'virgin' copy of 1.11.2 checked out and I can see the option for the news article url when editing an article. And see the option for displaying expired articles.
Is that News version 2.12.3?

When I upgraded to the last two versions of CMS Made Simple I had big problems getting the upgrade to work with the news module present - the only workaround I could come up with was to delete the news folder in modules, and then reinstall news through the forge later.

From the digging I did then it appeared that the issue was something php related that may not have been enabled on the server - could this be supressing some of the options?

I intend to try overwriting the News module (again) with a fresh version from the forge - any reason that might break things further?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News 'more' link returns a 404 error

Post by calguy1000 »

News Version 2.12.9 was released with the CMSMS 1.11.2.1
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

calguy1000 wrote:News Version 2.12.9 was released with the CMSMS 1.11.2.1
Ah ok - it looks like when I had to delete and reinstall it, the version I was getting from the Forge was older. I've moved the news directory straight from the 1.11.2.1 tarball, and I now have all of those options.

As a sideline, I have now unfortunately lost all of my old news articles. Time to test if it works now!
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

OK, so we have the latest version of News installed, and I'm just trying to get all the articles and templates restored from the backup.

However, if I click on the detail link, I'm still getting a 404 error.

In my site files, I have found a folder called news/ (i.e. www.stormforce.biz/news/) which just contains a .htaccess file, the contents of which are as follows:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Rewrite for NEWS
# requested URL looks like /news/12/13.html rewrite is
# index.php?mact=News,cntnt01,detail,0&cntnt01articleid=12&cntnt01returnid=13
# first number is article, second is returnid; NC = nocase, L=last (rule)
RewriteRule ^([0-9]*).html$ index.php?mact=News,cntnt01,detail,0&cntnt01articleid=$1 [NC,L]
RewriteRule ^([0-9]*)/([0-9]*).html$ index.php?mact=News,cntnt01,detail,0&cntnt01articleid=$1&cntnt01returnid=$2 [NC,L]
That's obviously dealing with the pretty URLS for the news module - could that one be where the issue lies?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: News 'more' link returns a 404 error

Post by velden »

I guess you broke your Blog now

http://www.stormforce.biz/information-p ... blogs.html

Code: Select all

Error: at line 127 in file /home/storm/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php:

Message:

Unable to load template module_db_tpl 'News;summarySF_Blog_2012'

JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

velden wrote:I guess you broke your Blog now
Yep! I'm just rebuilding everything now - somewhere along the line I uninstalled everything. I've restored some of the old news articles and blog posts from a database backup, but I'm missing all my templates etc.

To top it all... my news articles are still suffering the same problem!
JimboDavies
Forum Members
Forum Members
Posts: 130
Joined: Fri Feb 25, 2011 3:58 pm

Re: News 'more' link returns a 404 error

Post by JimboDavies »

Well, so far my digging hasn't borne any fruit. I'm becoming increasingly convinced it's a mod_rewrite issue - I've tried both specifying a URL when I post an article, and leaving it blank.

My latest news article shows up fine in the summary, it's just the more link to a detail page that isn't found - for example http://www.stormforce.biz/news/55/62/In ... -2012.html.

I have checked expiration dates settings in the admin panel (an install of the new News module brought them back) and everything should be good to work - the detail page is also set correctly.

Calguy - I know you're a busy man, but if you had any brief time available to offer some alternative suggestions I can try, I'd be very grateful. Likewise if anyone else has any suggestions, thanks!

Jimbo
Post Reply

Return to “Modules/Add-Ons”