RSS linking question/filenames

zynizen

Registered
I was wondering, if I don't want to use feedburner to publish RSS because the feed looks like crap (all that free advertising etc, its too hard for readers of my site to comprehend whats on the screen)

I've created an xml file and validated it properly etc.
I created a subdomain called: http://rss.mydomainhere.com

and the only file I have inside that folder is my "feed.xml" file.
How do I get around typing in the actual xml filename to view my feed?

I just want the above website address to view my feed like the rest of the world seems to know how to do.. am I missing something?

Also, is there any way to add good analytics to track feeds? I know google just bought out feedburner but, until then and until improvements come up, I just want simple access via the url above.

Thanks a lot!
 
You can do it easily through an http redirect as long as you have the ability from your host to use .htaccess files.
Create a file called .htaccess at the root directory for that sub domain.
In your .htaccess file put this code
Code:
Redirect 301 /index.html http://rss.mydomainhere.com/rssfile.xml

All web browsers when going to a URL that does not specify a file like rss.mydomain.com/page.html will send an http request for index.html or index.php. You can capture this with the .htaccess file and redirect them by giving the http 301 response code.

Alternatively if you don't have .htaccess because your host doesn't allow it, you can use php to set the header. Create a file called index.php and put this in it:
Code:
header("Location: /rssfile.xml",TRUE,301);

You can also do
Code:
header("Location: /rssfile.xml");
but setting the 301 http code will be more useful because search engines will remember it. The 301 code tells browsers and search engines that your page has moved permanently and the search engine should update it's index to directly point to the xml file in the future.
 
Back
Top