Page Rules have been part of the QuantCDN platform from the beginning, but we recently added some updates that you might find handy. Let’s take a quick look at the various rule options in your dashboard. You can also check out our recent changelogs for more details on feature updates.
What are Page Rules?
At a very high level, Page Rules allow certain things to happen when a user goes to a particular page or a set of pages on your website. They are very flexible, and you can create multiple rules and order them based on priority. Rules are a powerful tool for managing your web traffic.
Some common use cases are adding authentication on certain web pages, redirecting from one web page to another, or passing traffic through (via “proxy”) to a backend web server. Some rules can also be combined such as password protection and proxying.
Don’t forget to test your Page Rules on a development site before using them in production. Feel free to contact us if you have any questions about usage.
How to use the Page Rules feature
You should see the Rules feature in your dashboard menu under Extensions. Check out the Page Rules documentation for more details on how to use them.
Configuring Page Rules is simple for most use cases. They have two parts: the conditions that cause the rule to trigger, and what happens when the rule is triggered.
- You first define what URLs are associated with the rule. For example, if you want just one page,
https://www.example.com/about/contact, you would use the URL
/about/contact(assuming your website is
example.com). The URL is required but you can use wildcards (e.g.
/about/*) if you want the rule to apply to multiple URLs.
- Next, you configure any additional conditions that should be checked such as certain IP addresses or countries. For example, maybe you want anyone from Germany to get redirected to a different page if they go to
/about/contactbecause you have a special office in that country. Check out our recent post on geolocation-based rules for more use cases.
- Lastly, you configure the rule’s action. This is what you want to happen if the conditions for the URL(s) are met. For example, you can redirect the user, show them different content, require them to log in, etc.
What actions are available?
There are many actions you can use for your rules:
- Password protection: This action allows a basic authentication login popup to show up on the URLs you’ve specified, which can be helpful for controlling access to certain parts of your website.
- Redirects: Adding redirects is helpful if you have content that has changed URLs or is no longer available and you want to get the user to the best web page.
- Custom response headers: Response headers are hidden from the user and don’t show up in the web content, but can be used for things like caching, SEO, and authorization.
- Custom response: If you want to just show something in particular, like a simple maintenance message, you can use the “Custom response” action.
- Proxies: The Proxy action has a lot of configuration settings. The simplest use case for this option is to direct traffic hitting certain URLs to a different destination such as a backend server with a dynamic web page. Note, proxies are different than redirects. See more information in the CDN Proxy documentation.
If you have any questions or have suggestions for making the Page Rules feature more useful, contact us and let’s talk!