Url rewrite not working

Here is the code
my expectation would be the new url page would appear in the browser. it does not
Is there something else i am supposed to do?

the path i expected ot to show was [Tools – David Lee Smith (david-lee-smith.myshopify.com)] (Tools – David Lee Smith)

Edit Transform Rule
Rule name
Give your rule a descriptive name
Redirect-Dav to Shopify
When incoming requests match…
Field
URI Full
Operator
equals
Value
https://davidleesmith.com/collections/tools
Expression Preview
Edit expression
(http.request.full_uri eq “https://davidleesmith.com/collections/tools”)
Then…
Rewrite
Path

Preserve
Maintains the path from the original request.

Rewrite to…

e.g. content/images/thumbnails
Static
/

Query

Preserve
Maintains the query from the original request.

Rewrite to…

e.g. page=1234

The formatting does not look good. Can you please post a screenshot of the URL rewrite rule?

This is true, but I am afraid only for your expectation (no offence, might be a bit misunderstanding of the terms used here).

Using Transform Rule → Rewrite, you will see “old” URL in your web browser, while the main task and the thing is done and working “behind the scenes” as it is supposed to.

That’s how URL Rewrite works.
You won’t see the new modified URL in the URL address bar of your Web browser.

Yes, but if you made a rewrite, then the correct thing is done in the background.

Check HTTP headers via Dev tools (F12) or curl.

Redirect is not the same as Rewrite.

Redirect/Forwarding - This is a server-side response that tells the client to go to another URL. This means that the URL displayed in the browser’s address bar gets updated to the new URL

Rewrite - This is a server-side modification of the URL before it is fully processed by the web server. This will not change what is seen in the user’s browser.

Source article:

Is there a way in Cloudflare to redirect a URL or series of urls to a different domain.
I am trying to stop a 404 error from being returned and the user sent to a different domain. for example https://davidleesmith.com/collections/tools to be redirected to http://david-lee-smith.myshopify.com/collections/tools

May I share a recent post below, as from what I understand what you are trying to achieve it is related to the same.

Using Page Rule:

Just in your case, https://davidleesmith.com/collections/tools/* first field and https://david-lee-smith.myshopify.com/collections/tools/$1 in the second field while using Page Rules.
→ or maybe just https://david-lee-smith.myshopify.com/collections/tools/ in the second field (in case you do not have any “old” URLs and don’t want to follow URL path from “old” to the “new” one)

Otherwise, please reply so we could troubleshoot or help more.

no offence taken Thanks for the help

Here is what i am am configured
not worried about any other urls or wildcards at this time.

Try to use Page Rules, instead of Transform Rules.
Delete/Disable this Transform Rule.

I was referring to them :point_up:

will do

that worked perfectly! Thanks, Now ill look into the other with wildcards, ill review waht you posted thanks again, you saved me a ton of work so far,

1 Like

what i changed

got this error 404 Not Found – David Lee Smith (david-lee-smith.myshopify.com)

any thoughts?

disregard last i had 1$ instead of $1
again, thanks for all your help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.