This is especially for Scalev Lite plan users whose custom domain allowance is only 1 (one) active domain. Or any paid Scalev user who wants to conserve their custom domain quota. This trick is worth trying. Before following the instructions in this article, I’ll assume you’ve already added a custom domain following this tutorial → https://tutorial.scalev.id/azcustomdomain/Documentation Index
Fetch the complete documentation index at: https://docs.scalev.com/llms.txt
Use this file to discover all available pages before exploring further.
Benefits of Redirecting www to Your Main Domain
- URL consistency: Simplifies URLs so they always point to one version.
- Avoiding duplicate content: Prevents search engines from treating the www and non-www versions as two separate sites.
- Improved SEO: Consolidates authority and rankings to one URL version.
- More accurate analytics: Makes it easier to track data and site performance in a single version.
- Consistent user experience: Directs users to the same version every time they access the site.
- Saves your custom domain quota in Scalev.
Why redirect?
A domain name has two versions that visitors can use: the www version and the non-www version. Example:- army.id (non-www version)
- www.army.id (www version)
How to Redirect www to Your Main Domain
1. Log in to your Cloudflare account 2. Select your active domain 3. In the left sidebar, find Page Rules 4. On the Page Rules page, click the blue Create Page Rule button 5. Fill in the rule settings exactly as shown in the screenshot below: Adjust for your own domain.- URL (required): *www.army.id/**\
- Pick a Setting (required): Forwarding URL
- Select status code (required): 301 - Permanent Redirect
- Enter destination URL (required): https://army.id
Adding new CNAME records
After creating the Page Rule above, you need to make sure CNAME records for www and * have been added. If they don’t exist, create new records. You need to create 2 new CNAME records:- CNAME www pointing to @
- CNAME * pointing to @
* = wildcard (random subdomains that don’t exist) Example: The www redirect with Cloudflare is now set up. Test accessing your domain in both the www and non-www versions. If successful, the main page of your main domain will appear. The www version redirects to the non-www version. If not successful, check the FAQ below.
FAQ
I’ve created the Page Rule as instructed but still can’t access it. Why? There are several possible reasons you can’t access the www version even after following the instructions above. Such as:- Browser cache
- Internet network cache
- CNAME not added yet, etc.
- Page Rule status not yet enabled
- Main domain page not set in Scalev
- Clear the cache in your browser
- Reset/restart your internet connection
- CNAME for www and * has been added to your active domain
- Make sure the Page Rule is active (green)
- Make sure you’ve set the main page for your domain in Scalev
- URL (required): army.id/ (remove www)
- Pick a Setting (required): Forwarding URL
- Select status code (required): 301 - Permanent Redirect
- Enter destination URL (required): https://www.army.id (add www here)

