e/shortener
2023-03-17 12:15:26 +00:00
..
.gitignore feat: add url shortener 2023-03-17 11:47:38 +00:00
index.php fix(shortener): php7 compat and fix sample nginx configuration 2023-03-17 12:15:26 +00:00
README.md fix(shortener): php7 compat and fix sample nginx configuration 2023-03-17 12:15:26 +00:00

ash.ley

A simple link shortener. Its a single PHP script which requires a small about of webserver configuration. Adding new links just requires adding a file to the links/ folder containing the URL to link to.

Webserver configuration

server {
    server_name ash.ley;
    root /var/www/ash.ley;
    
    location ~ ^/links {
        deny all;
    }
    
    location / {
        rewrite ^/(.*) /index.php?l=$1&$args;
    }
    
    location ~ ^/index.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}