http://localwebsite { # Set this path to your site's directory. #root * /usr/share/caddy root * /var/www/website #makes /course/id/name.html to /course.php?id=id&name=name @zxp { #path_regexp myregex ^/course/(\d+)/([%A-Za-z0-9_-]+)\.html$ path_regexp myregex ^/course/([^/]+)/([^/]+)\.html$ } rewrite @zxp /course.php?id={re.myregex.1}&name={re.myregex.2} # rewrite /course/([^/]+)/([^/]+)\.html /course.php?id={1}&name={2} ...
Points regarding computing that I always forget - so I write them here to find them easily and maybe other could benefit too.