Tinify is a simple PHP URL shortner web application
Tinify is already online at tinify.co. You can check it out to see how it looks and works
Additionaly, Tinify is designed to work with an API, so different apps can use it. Currently the Android app is available on Play Store
In order to install tinify on your own server you need to install a web server (tinify.co runs on nginx) and MySQL. To install and run follow these simple steps
- Download and unzip the files on the main web server directory.
- Edit file
config.php
with the correct data - From the DATABASE directory import the data to MySQL. Start with
tinify.sql
and then importip2nation.sql
- The application should be ready to run, however to be able to redirect using
/abc
you need to configure rewrite on your web server. For nginx see Rewrite Rules below. - Make other changes if necessary.
#####Rewrite Rules This is an example for nginx, if you are running Apache or something else please refer to the documentation
map $uri $rewrite {
/ 0;
"~*(\/.*\/)" 0;
"~*(\.)" 0;
default 1;
}
server{
...
location / {
try_files $uri $uri/ =404;
if ($rewrite = 1){
rewrite ^/(.*)$ /redirect.php?url_id=$1 last;
}
}
}