Ahmad Naser Turnkey Ecosystem Ahmad Naser
September 24, 2021

Nginx Rules for Premium URL Shortener

Published in the Ahmad Naser ecosystem. Estimated reading time: 1 minute.

if you are looking for premium hosting for url shortener, we highly recommend www.greenbackend.com

the following nginx rules are required on vps

 # START rewrite rules
  location /links {
    try_files $uri /links/index.php?$args;
    if (!-e $request_filename)
    { 
        rewrite ^/links/(.*)$ /links/index.php?a=$1 last;
         
        break; 
    }
  }

  location /links/admin {
    try_files $uri /links/admin/index.php?$args;
  }



location / {
    rewrite ^/(.*)$ /index.php?slug=$1 last;
    try_files $uri $uri/ /index.php;
  }
 # START rewrite rules
  location /links {
    try_files $uri /links/index.php?$args;
    if (!-e $request_filename)
    { 
        rewrite ^/links/(.*)$ /links/index.php?a=$1 last;
         
        break; 
    }
  }

  location /links/admin {
    try_files $uri /links/admin/index.php?$args;
  }






    location / {
        index index.php index.html;
        try_files $uri $uri/ /index.php?$args;
    }

Leave a Reply

Your email address will not be published. Required fields are marked *