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
Chaika
Chaika•15mo ago
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 alrready
LukeZ
LukeZ•15mo ago
ah!
and you can turn on keep query string as well
I've read the docs, but I don't understand for what this is good for Hmm
Chaika
Chaika•15mo ago
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
LukeZ
LukeZ•15mo ago
ah!
LukeZ
LukeZ•15mo ago
hmm... I did this, but it doesn't work...
Chaika
Chaika•15mo ago
What's your match section, and what's the site/what error are you getting?
LukeZ
LukeZ•15mo ago
I get the error "Timed out" Try connecting to https://supportmail.dev
Chaika
Chaika•15mo ago
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?
LukeZ
LukeZ•15mo ago
oh bruh. I changed it to dynamic before and it reset itself lol
LukeZ
LukeZ•15mo ago
LukeZ
LukeZ•15mo ago
www if from Google Sites and docs from Gitbook.
Chaika
Chaika•15mo ago
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 www
LukeZ
LukeZ•15mo ago
oh bruh 😂 only this?
Chaika
Chaika•15mo ago
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
LukeZ
LukeZ•15mo ago
oooh hmmNice It works just fine now Thank you!!
Want results from more Discord servers?
Add your server