Feedback on redir doc page


(Federico Bruni) #1

It took me some time to figure out how to do a simple redirect from an old domain to a new domain.
Eventually I managed to do it, but I want to share what happened and see if there’s room to improve the redir doc page.

Objective: I don’t care about preserving URIs, I just want that when you visit any domain1.com URI you are redirected to domain2.com.

Here’s what I tried first:

domain1.com {
  redir https://domain2.com 301
}

It didn’t work. Then I read that 301 is the default status code, so I simplified it to:

domain1.com {
  redir https://domain2.com
}

This did work. Why?
BTW, the doc is not clear whether we should use 301 or [301]. In my first example I tried both but did not help.


(Matt Holt) #2

The examples of the redir docs have a correct example for what you’re trying to accomplish. What would you like to improve about it?

When describing syntaxes, it’s standard practice to enclose optional arguments in square brackets.


(Federico Bruni) #3

Right, I should have thought about that. Then nothing to improve here.


(Matt Holt) #4

No problem, I can see how it’s not obvious. Maybe we need a page in the documentation about how to read the documentation! :sweat_smile:

Anyway, thanks for posting this; I am glad it is working for you.


(system) #5

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