Contributed by rueda on from the and-there-was-much-rejoicing dept.
Reyk Floeter (reyk@) has committed support for simple request rewrites to httpd(8)/ httpd.conf(5) [in -current]:
CVSROOT: /cvs
Module name: src
Changes by: r...@cvs.openbsd.org 2018/06/20 10:43:05
Modified files:
usr.sbin/httpd : config.c httpd.conf.5 httpd.h parse.y
server_http.c
Log message:
Add support for simple one-off internal rewrites.
For example:
location match "/page/(%d+)/.*" {
request rewrite "/static/index.php?id=%1&$QUERY_STRING"
}
Requested by many.
Ok benno@
(Comments are closed)

By Will Backman (bitgeist) bitgeist@yahoo.com on http://bsdtalk.blogspot.com
Would this allow the rewrite of http to https?
I’m used to this rewrite in Apache:
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
If so, what would the syntax be?
By rueda (rueda) on https://www.openbsdfoundation.org/donations.html
A change of protocol implies client involvement and normally just involves redirection.
From /etc/examples/httpd.conf:
location * { block return 302 "https://$HTTP_HOST$REQUEST_URI" }Did you have something else in mind?
By Will Backman (bitgeist) bitgeist@yahoo.com on http://bsdtalk.blogspot.com
As usual, the best answers are right there in the installed documentation. :)
Than you!
By Atanas Vladimirov (vlado) vlado@bsdbg.net on
Does anyone know if this rewrite could be used with wordpress permalinks and how?
Thanks,
Atanas