aboutsummaryrefslogtreecommitdiff
path: root/Caddyfile
blob: 404b190d202b1e1e5bd1b16040244c67282938ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
:80 {
        # Site's directory
        root * /var/www/html/src

        # Block direct access to JSON data files
        @jsonFiles path *.json
        respond @jsonFiles 404

        # Enable the static file server.
        file_server

        # Or serve a PHP site through php-fpm:
        php_fastcgi unix//run/php/php8.4-fpm.sock


        # Prettify the links

        ## HOME ##
        rewrite /home /index.html
        rewrite /home/ index.html

        ## GUESTBOOK ##
        rewrite /guestbook /Pages/guestbook/guestbook.php
        rewrite /guestbook/ /Pages/guestbook/guestbook.php

        ## CONTACT US ##
        rewrite /contact /Pages/contact.html
        rewrite /contact/ /Pages/contact.html


        ## MUSIC ##
        rewrite /music /Pages/music.html
        rewrite /music/ /Pages/music.html

        ## BLOG ##
        # Blog list
        rewrite /blog /Pages/blog/blog.php
        rewrite /blog/ /Pages/blog/blog.php

        # Individual post
        @blogPost {
            path_regexp blogPost ^/blog/(.+)$
        }
        rewrite @blogPost /Pages/blog/blog.php?post={re.blogPost.1}

        ## PORTFOLIO ##
        rewrite /portfolio /Pages/art/portfolio.html
        rewrite /portfolio/ /Pages/art/portfolio.html

        # Individual portfolio image
        @portfolioImage {
            path_regexp portfolioImage ^/portfolio/(.+)$
        }
        rewrite @portfolioImage /Assets/art/{re.portfolioImage.1}

        ## COMMISSIONS ##
        rewrite /commissions /Pages/commissions/commissions.php
        rewrite /commissions/ /Pages/commissions/commissions.php

        ## ASSETS ##
        @asset {
            path_regexp asset ^/assets/(.+)$
        }
        rewrite @asset /Assets/{re.asset.1}
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile