View Single Post
  #2  
Old May 4th, 2008, 07:10 AM
Captain Code's Avatar
Captain Code Captain Code is offline
Moderator
 
Join Date: Aug 2001
Location: Ontario, Canada
Posts: 3,085
Captain Code will become famous soon enough
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.
__________________
MacBook Pro 2.16GHz Core2Duo 3GB RAM, G4 1.4GHz OSX Tiger 1.25GB RAM, Dual 2GHz G5 OSX Tiger 2GB RAM (freakin shweet)
Athlon 64 Windoze XP for school work (programming) 1GB RAM
dferns@macosx.com
Reply With Quote