How to use the Dynmaic Redicts?
What do I have to enter here?
I want to do it, that when the user types in e.g.
example.com/page1
it redicts him automatically to www.example.com/page1
.
It should always put a www.
in front of the url the user tyoed in.15 Replies
You can't use regex like replacements like that.
Bulk Redirects make this a bit easier, it's only one click to keep path, but if you want to stick with a dynamic redirect, change the expression to
concat("https://www.example.com", http.request.uri.path)
, and you can turn on keep query string as well
The match should be something like Hostname
equals
example.com
if not alrreadyah!
and you can turn on keep query string as wellI've read the docs, but I don't understand for what this is good for
It's good for keeping query strings. Query strings are the part after the ? in a url, like for example https://example.com/page?query=value, query=value is the query string part
Some Websites use query strings for various purposes, its possible your site doesn't
ah!
hmm... I did this, but it doesn't work...
What's your match section, and what's the site/what error are you getting?
I get the error "Timed out"
Try connecting to https://supportmail.dev
oh I see one problem already, that needs to be type dynamic and not static
What's the full rule though, specifically the match section of that?
oh bruh. I changed it to dynamic before and it reset itself lol
www
if from Google Sites and docs
from Gitbook.The Uri path is the part after the slash, ex. www.example.com/cookies, the path is /cookies, your rule would only execute for https://supportmail.dev/supportmail.dev
Change it to
Hostname
equals
supportmail.dev
, this would only match your apex, and not any subdomain like docs.supportmail.dev or wwwoh bruh 😂
only this?
yep, hostname is the first part of the URL, after the scheme (https), ex https://www.example.com hostname is www.example.com, https://example.com hostname is example.com, https://cookies.cookies.example.com/hihi hostname would be
cookies.cookies.example.com
oooh It works just fine now
Thank you!!