2

I have created RSS feed template (named as 'feed') to pull data from the blog channel and it looks like

{preload_replace:master_channel_name="blog"}
{exp:rss:feed channel="{master_channel_name}"}

<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>

    <title><![CDATA[{channel_name}]]></title>
    <link>{channel_url}</link>
    <description>{channel_description}</description>
    <dc:language>{channel_language}</dc:language>
    <dc:creator>{email}</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />

{exp:channel:entries channel="{master_channel_name}" limit="10" dynamic_start="on" disable="member_data|pagination"}
    <item>
      <title><![CDATA[{title}]]></title>
      <link>{title_permalink='site/index'}</link>
      <guid>{title_permalink='site/index'}#When:{gmt_entry_date format="%H:%i:%sZ"}</guid>
      <description><![CDATA[{summary}{body}]]></description>
      <dc:subject><![CDATA[{categories backspace="1"}{category_name}, {/categories}]]></dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    </item>
{/exp:channel:entries}

    </channel>
</rss>

{/exp:rss:feed}

but when I will refer browser to feed url like http://www.mydomain.com/feed I'm getting 404 Not Found.

Any clue what can be missing?

Thanks

1 Answer 1

5

I'm guessing it's just the way your templates are set up. Is your template group called feed.group? And the template itself called feed.xml?

If that's the case it will need to be accessed at http://example.com/feed/feed. Or you can change your RSS template to be feed.group/index.xml so you can access it at http://example.com/feed as desired.

If this misses the boat, please update your question with a little more information on your template setup and I can try to be more helpful.

UPDATE based on your comments:

Since you have strict URLs enabled you will not be able to access the default template group's templates without also including the default template group's name in the path. See this EllisLab blog post as well as this answer on Stack Exchange for more info.

So in your case, since the feed is in your default template group, site.group, the URL you need to use when Strict URLs is enabled is http://example.com/site/feed.

9
  • This is right. The URL will have both the template group name and template name. For example, I often create an RSS template named rss in the blog template group, and my feed URL is then: example.com/blog/rss
    – Jay F
    Sep 4, 2013 at 16:37
  • OK, I have found that childrensmedgroup.com/index.php/site/feed works but links withing feed are not correct :\ Sep 4, 2013 at 16:39
  • JackTheKnife, Do you have Strict URLs enabled? Are you using .htaccess to remove index.php?
    – Alex Kendrick
    Sep 4, 2013 at 16:47
  • @AlexKendrick - yes, Strict URLs are enabled. .htaccess has rewrite rule to get URLs without index.php to work. Sep 4, 2013 at 17:43
  • That you have Strict URLs enabled (which is a good thing generally) explains why you are getting a 404 when trying example.com/feed. See my updated answer.
    – Alex Kendrick
    Sep 4, 2013 at 17:54

Your Answer

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

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