Most of the time, you need to redirect the user to a particular address so as to improve the SEO or the Backward Compatibility. In this user guide from ArvanCloud, we will discuss the different types of redirection on ArvanCloud CDN.
Redirect to WWW or Vice Versa
As the two addresses www.test.com and test.com, refer to two different websites that possibly contain diverse content, the search engines index them separately, and the websites ranking in search engines are also distinct.
Therefore, the first step to optimize a website is to have a single domain name. For example, you can determine which one of the above addresses has to be your website's primary address. However, when you select one of the domains as the primary one, you have to redirect the other domains traffic load toward that one.
To do this, follow the instructions below:
- Open the CDN section on the ArvanCloud user panel.
- Click on the Other Settings option on the right menu.
- Select a domain as the primary one
- Check that the other addresses automatically redirect to it.
For example, if the test2.ir is your primary domain, you have to check the automatic redirection from www.test2.ir to test2.ir.
Redirect to HTTPS
If you aim to make the users' access to your website secure, your website has to use HTTPS rather than HTTP. To do so, you should redirect every user who uses HTTP to access your website via HTTPS.
- Go to the ArvanCloud users panel> CDN > HTTPS Settings.
- Activate the "Automatic Redirection from HTTP to HTTPS".
Tip: If you are redirected to HTTPS, and the mentioned Status Code is 307, the Redirection has occurred due to HSTS by your browser.
Redirect to an Arbitrary Address
If you intend to redirect the users to an arbitrary address, you should create a rule for that address in order to redirect every request to it. In the following instruction, you will learn how to do so:
Redirection Due to the DDoS Protection Activation
In the ArvanCloud cloud security general challenge, the users, in order to prevent the DDoS attacks, have to save a required cookie and submit all their requests through it. Accordingly, they affirm that they are not robots.
For this purpose, the users' first request will be responded by 307 that contains the required cookie. In case the Redirection causes APIs to be out of order, you can deactivate the property by creating a rule for that API.