RejectedSoftware Forums

Sign up

301 redirects

What is the easiest way to perform 301 redirects directly in vibe.d? 301 redirects are small and easy for browsers and search engines to deal with appropriately, and essential for SEO when pages change location on a permanent basis. Equallly 302 redirects would be nice to do also.

I think I'd like something like permanentRedirect and temporaryRedirect functions which do the right things, and documentation which explains the functionality clearly.

Re: 301 redirects

On Sat, 31 May 2014 22:27:43 GMT, w0rp wrote:

What is the easiest way to perform 301 redirects directly in vibe.d? 301 redirects are small and easy for browsers and search engines to deal with appropriately, and essential for SEO when pages change location on a permanent basis. Equallly 302 redirects would be nice to do also.

I think I'd like something like permanentRedirect and temporaryRedirect functions which do the right things, and documentation which explains the functionality clearly.

HTTPServerResponse.redirect takes a status parameter to set a custom status. staticRedirect didn't do so far, but I've added one plus some better documentation in cbf3bfa.

Re: 301 redirects

On Sun, 01 Jun 2014 08:37:52 GMT, Sönke Ludwig wrote:

On Sat, 31 May 2014 22:27:43 GMT, w0rp wrote:

What is the easiest way to perform 301 redirects directly in vibe.d? 301 redirects are small and easy for browsers and search engines to deal with appropriately, and essential for SEO when pages change location on a permanent basis. Equallly 302 redirects would be nice to do also.

I think I'd like something like permanentRedirect and temporaryRedirect functions which do the right things, and documentation which explains the functionality clearly.

HTTPServerResponse.redirect takes a status parameter to set a custom status. staticRedirect didn't do so far, but I've added one plus some better documentation in cbf3bfa.

Ah, thank you. response.redirect(url, 301) does the trick. You should put in a paragraph about performing 301 and 302 redirects in the documentation on vibed.org. It would be nice to just Ctrl + F "301" and find it on the page.