Bunny.net edge rules screenshot

Prevent Search Engines From Indexing Bunny.net Storage Zones

I have about 15gb of files sitting on a website that were very rarely getting accessed, but taking up space on my server. So I had the idea to move them to a storage zone on Bunny.net (formerly Bunny CDN), as I’ve got an account with a grandfathered plan that only costs me $10 per year, and I’m barely using any of the credits.

Although these files aren’t very sensitive, I still don’t want them showing up in Google’s search results. The easiest way to tell search engines to go away is to add a noindex tag, and we can very easily do this using Bunny.net’s ‘Edge Rules‘.

When you have your ‘Storage Zone‘ and ‘Pull Zone‘ set up, click on ‘CDN‘ in the left menu, and click on the pull zone you have set up. Select ‘Edge Rules‘ from the menu.

Bunny.net add an edge rule

Create a new rule, call it whatever you want. Under ‘Actions‘ choose ‘Set Response header‘. For the ‘Header Name‘ type ‘X-Robots-Tag‘. For the ‘Header Value‘ type ‘noindex‘.

Bunny.net edge rule action

Under the ‘Conditions‘ section, this is where you apply where you want this rules to apply. In my case I wanted everything and anything in my storage zone to have the noindex applied to it. So I just added my storage zone URL with a slash and a star to indicate a wildcard rule. However you can get as precise as you want, it’s super flexible.

Bunny.net edge rule condition

To check whether the tag has been implemented, load a file inside the storage zone in your website browser. Open your browser’s developer tools, for most browsers you can access it by pressing ctrl+shift+i. Click the ‘Network‘ tab and then refresh the page. Click the file name your testing in the left column under ‘Name‘. Under the ‘Headers‘ tab scroll down until you see ‘Response Headers‘. Scroll until you find ‘X-Robots-Tag‘ and ensure the value is set to ‘noindex‘.

Response header chrome browser developer tools

Congratulations, you have successfuly noindexed a Bunny.net storage zone.

Share:

Want to create something together?

I like working with nice people on cool projects - let’s start a conversation at Brew.
Contact me

Leave the first comment