Page Redirection Issue
I have added a page redirection rule 'www.domain.com/*' redirect to 'domain.com/$1'.
it is working..
but it not redirecting to the paths. for example:
'www.domain.com/path1/path2' also redirecting to 'domain.com'
In this scenario I want to redirect www to non-www along with the path.
3 Replies
Have you tried creating a Redirect Rule with a dynamic type and the following
concat("https://domain.com", http.request.uri.path)
Essentially will take the requests uri path (`/path1/path2') and append to https://domain.com etcWebsite Domain Names, Online Stores & Hosting
Finding the perfect website domain is as easy as 1-2-3. Buy a domain name, build and host a website, and enjoy our professional online marketing tools.
I think you use the old page rule syntax where this worked. You need to use the new RuleSetEngine. Here is an example that should work: https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/#redirect-all-requests-to-a-different-hostname .
Single Redirects — Example rules · Cloudflare Rules docs
The following sections contain example single redirect rule configurations.
@z0rrn @semaja2 Thank you for bringing me out of the issue. the solution you shared works.