How to Whitelist Hostnames for Embedding Bots on Your Website
Learn how to whitelist hostnames to embed bots on your website and avoid 'forbidden' errors
What does whitelisting mean?
When you embed a bot or script on your website, you might encounter a "forbidden" message. This happens because the bot's server doesn't recognize your website as an allowed entity.
To fix this, you need to whitelist your website's hostname. Whitelisting is a security measure that allows specific entities (like websites) to access certain resources or perform certain actions. When you whitelist something, you are essentially saying, "I trust this, and it is allowed to interact with my system."
Understanding hostnames
While the hostname is often the same as the website name, this is may not always be the case, particularly with managed websites like Google Sites or Blogspot.
Hostnames can be categorized into two types:
- Static Hostname: A static hostname is a web address that doesn't change. It's fixed and remains the same every time you visit the website. If you have your own website with a fixed domain name like "mywebsite.com", this is a static hostname.
- Dynamic Hostname: A dynamic hostname is a web address that can change each time you visit the website. Platforms like Google Sites or Blogspot might use dynamic hostnames because they manage multiple websites and need to generate unique addresses for different pages or users.
How to Fix the "Forbidden" Message for Static and Dynamic Hostnames
-
Go to the web page where you see the forbidden message
-
Open Developer Tools: Right-click on your webpage and select "Inspect" or press Ctrl+Shift+I (Windows) or Cmd+Option+I (Mac).
-
Go to Network Tab: Click on the "Network" tab in the Developer Tools.
-
Refresh the Page: Press F5 or click the refresh button in your browser.
-
Find the Referer URL:
- On the [Filter] tab, search for "widget.writesonic.com"
- Click on "index.html?" from the filtered results on the "name" column to open the corresponding panel
- Scroll through the panel and search for the "referer" URL.
- Copy the referer URL to your clipboard. This can be either a dynamic or status hostname.
- Note: Dynamic hostnames contain a segment within the URL that frequently changes such as numbers, user IDs, or session tokens (see example below).
-
Go to your Bot's settings page.
- Click on [Integrations] from the left hand side menu
- Click on [Embed on your website]
- Click [Manage allowed hosts]
- Click [Add new allowed host]
- Copy the referrer URL from the Developer Tools and paste it into the "Allowed Hostnames" field.
Note: For dynamic hostnames, replace the changing part with an asterisk . For example, if the referrer is "https://1787877109-atari-embeds.googleusercontent.com", replace the number part of the URL with an asterisk, then add "https://*-atari-embeds.googleusercontent.com" to the "Allowed Hostnames" field.
- Click the [Save] button to save your changes.
- Press F5 or click the refresh button in your browser.
- Ensure that the bot appears on your website without any "forbidden" message.
Updated 6 months ago