the itjerk

my adventures with technology

Tag Archives: rss

hide xml from browsers

I publish a daily rss feed, an “Album Of The Day” type thing, that feeds various social media pages as well. It works automatically, so I don’t really have to do anything, other than make sure dlvr.it is working correctly (sometimes one needs to┬árenew app permissions). Down side, is that there’s a huge xml file out there that is easily accessible from any web browsers. It’s not that big of a deal, because, after all, I am publishing bits each day. But two lines of codes hides it from honest people:

First, create a css stylesheet. To hide everything, make sure the css applies to the root element of your xml file, which in my case is “albums”. Then you only need one line of code in your css file.

albums {visibility: hidden;}

Next, in the xml file, reference your stylesheet:

<?xml-stylesheet href=”rss.css” media=”screen” type=”text/css”?>

Ptoof! Empty page!

Of course, if you really want to hide that xml source, you’ll need to move it to a directory that’s not visible like /var/.