RFC: Should we make all redirects on Dub 302 by default? #659
Replies: 3 comments 1 reply
-
This is a good move and probably better follows the practices of link shorteners. The one edge case to be aware of is if the link owner changes the destination URL after a person has already visited the link, the browser will still visit the old destination URL since it catches the URL on a 301. I think this is a pretty large edge case, though. You could offer up the ability to choose and default to 301. Basically, if the user plans to change the destination URL, then they could use a 307. |
Beta Was this translation helpful? Give feedback.
-
Defaulting to 301 redirects for all redirects in Dub may limit flexibility for users.
In short, relying solely on 301 redirects limits the ability to modify destination URLs safely. |
Beta Was this translation helpful? Give feedback.
-
Noting the two comments above, having it configureable by the user may be better then always doing 301 redirects, perhaps giving the user a switch to pick from either |
Beta Was this translation helpful? Give feedback.
-
Update (Mar 9, 2024): This has been shipped: https://dub.co/changelog/redirect-status-codes
Edit: Have been doing a bit more research and it looks like 302 redirect is the best option here since unlike 301, it doesn’t cache the destination URL in the user’s browser (in case you made a typo/need to update the URL). It’s also ideal for SEO as per Google themselves.
Hey everyone! Building off of #182 – we've gotten a bunch of requests to support
301302 redirects recently, and since we haven't really heard anyone specifically request 307 redirects, we're thinking of changing all redirects on Dub to be301302 by default (for better SEO). Here's a 1-line PR of the change.Alternatively, we could also set 301 as the default for root domain redirects and 302 for all other links since you're less likely to update your root domain redirect.
In the future, we might add more granular options for each link (301, 307, 308), but for now,
301302 will be the default redirect behavior.What do you guys think?
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions