• Hey,

    I’m playing around with a WP install at localhost, running on XAMPP lite. I want to try all kinds of stuff before applying them to my real blog. Currently I’ve managed to get WP to act as a CMS of some sort, using this codex guide. Now I have a static front page at the root and a blog at /blog directory. What I want to do is to change the RSS feed url that it would be /blog/feed instead of just /feed. Can it be done and how?

    Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • If you’re running WordPress as a CMS, and have moved the index page to the root (while the wordpress installation is in the subfolder of “blog”) it’ll already do this.

    Give it a try – if you enter the URL for your site, then enter it with the URL/blog, you’ll see the same thing come up for both URLs. Your feed is the same.

    Thread Starter dotsi

    (@dotsi)

    Actually I have the whole thing at the root, no subdirectories at all.

    But, you said…

    “I have a static front page at the root and a blog at /blog directory.”

    so it’s *all* at the root? If it’s all at the root, then you don’t have a blog directory to send your RSS feed from. Out of curiosity – why would you what to have your feed show up with a different URL?

    Thread Starter dotsi

    (@dotsi)

    Yeah, well, the apparent subdirectory is the one made by the blog.php described in the codex guide. So there is no real /blog subdirectory.

    The reason why I want to do this is because I already have my current blog at /blog (on a real server unlike the sandbox I’m working on now) and I don’t want to break the RSS feeds’ url if I carry out the same changes there.

    As far as I know, there is no “blog.php” file in the WordPress installation. (I’ve been doing installations for a while, and I don’t ever recall seeing such a file.)

    I think I’m just getting confused here – can you provide a link to your site? Maybe that’ll help clear things up a little bit.

    Thread Starter dotsi

    (@dotsi)

    That’s right, there’s no blog.php in default WP installation, but the codex guide tells to create one with the given content.

    Unfortunately I can’t provide a link for now, because I’m experimenting on localhost.

    I’m sorry – can you tell me where in the codex it tells you to create this file? I’ve either forgotten, or I’m just a dolt, because I don’t remember seeing this anywhere.

    Thread Starter dotsi

    (@dotsi)

    It’s in here, right above the code part:

    Next, create a blog template. The easiest way to do this is to create a file named blog.php with the following contents in your theme directory

    Okay – now I see what you’re doing. Okay, so you have WordPress in the root, and you’re faking that it’s in another directory. I’ve actually never done it that way before – probably why I’m not familiar with this setup.

    From my understanding, the RSS feed will point to however your permalink structure is set up. You didn’t mention if you took this step or not.

    If you did, and it’s still not working, maybe try using .htaccess to rewrite the URL? I don’t know exactly how to do that…and I don’t know if that would mess up your current permalink structure (if you already have one).

    And example of using .htaccess to change your feed’s URL (this one uses feedburner – so you’ll have to edit it to suit your needs – but it gives you a starting point):

    Options +FollowSymLinks
    rewriteEngine on
    rewriteCond %{HTTP_USER_AGENT} !feedBurner
    rewriteCond %{QUERY_STRING} ^option=com_rss&feed=RSS2.0&no_html=1$
    rewriteRule ^index2\.php$ http://feeds.example.com/myfeedname? [R=301,L]

    the “^index2.\php” being the current link to the feed, and the stuff from “http://...” on would be the new URL.

    You *should* be able to append this into your current .htaccess file – but like I said, I don’t know what effect this will have on the rest of the site, and you’ll have to play with that a bit to get exactly what you want.

    After all of that, I hope it helps!

    Thread Starter dotsi

    (@dotsi)

    Sorry for the long (4-month O__o) delay, but now I got everything up and running.

    What I’d like to do now is to redirect/rewrite the RSS feed url from example.com/feed/ to example.com/blog/feed/ (and also the comment feeds from example.com/comments/feed/ to example.com/blog/comments/feed/). What would be the simplest way to do that?

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Changing the RSS feed URL’ is closed to new replies.