Overview
Discover what makes Simple-URL-Shortener powerful
Simple‑URL‑Shortener is a minimal, KISS‑compliant URL shortener written in vanilla PHP that supports both MySQL and SQLite backends. Its core purpose is to expose a lightweight API for creating, retrieving, and managing short links without the bloat of modern frameworks. The application exposes a web interface for users to register, log in, and create short URLs with optional comments. The comment field is the primary search aid; it allows developers to tag links for later retrieval, which can be leveraged in larger systems that need human‑readable metadata on short URLs.
Stateless PHP core
Dual‑database support
User management
Comment‑driven search
Overview
Simple‑URL‑Shortener is a minimal, KISS‑compliant URL shortener written in vanilla PHP that supports both MySQL and SQLite backends. Its core purpose is to expose a lightweight API for creating, retrieving, and managing short links without the bloat of modern frameworks. The application exposes a web interface for users to register, log in, and create short URLs with optional comments. The comment field is the primary search aid; it allows developers to tag links for later retrieval, which can be leveraged in larger systems that need human‑readable metadata on short URLs.
Key Features
- Stateless PHP core – no external dependencies beyond the PHP runtime and a database driver.
- Dual‑database support – works out of the box with MySQL or SQLite, giving developers flexibility to choose a lightweight file‑based store for low‑traffic sites or a robust relational engine for production.
- User management – simple authentication with cookie‑based sessions (secure flag enforced on HTTPS). The first registered user becomes an admin, providing a quick path to enable link analytics or bulk operations.
- Comment‑driven search – every short URL can have an optional comment; the UI lists links grouped by user and searchable via keyword, making it useful for internal documentation or tracking campaigns.
Technical Stack
| Layer | Technology |
|---|---|
| Language | PHP 7.x (compatible with 8.x) |
| Web Server | Apache (via .htaccess) or Nginx (rewrite rules provided) |
| Database | MySQL / MariaDB, SQLite3 |
| Frontend | Pure HTML/CSS with minimal JavaScript; no framework dependencies |
The application is intentionally unopinionated: it ships a single index.php that routes all requests through URL rewriting. The routing logic is simple: the path component becomes a query parameter (site) which is then resolved to either a short URL or a page. This design keeps the codebase small and easy to audit.
Core Capabilities & API
- REST‑style endpoints – While the UI is primarily HTML, the same logic can be reused to build a lightweight JSON API:
POST /?action=create– create a short link (url, optionalshort,comment).GET /?site={code}– redirect to the original URL.
- Admin actions – List all users’ links, delete or edit entries, and export link data.
- Configuration –
inc/config.phpholds database credentials, base URL, and security flags. The file can be templated for Docker or CI pipelines.
Deployment & Infrastructure
The project is designed for self‑hosting on any LAMP or LEMP stack. A single PHP file per request means it scales linearly with CPU, and SQLite support allows deployment on edge devices or CI runners. For production workloads, the recommended setup is:
- Docker – a lightweight image with PHP‑FPM and Nginx, mounting the source code as a volume.
- High‑availability – duplicate instances behind a load balancer; the database layer is the single point of contention, so use replication or read‑replicas if needed.
- Security – the app forces HTTPS for cookie transmission; it also denies access to
.sqlite3and.htfiles via Nginx rules, protecting the database file from direct download.
Integration & Extensibility
The codebase exposes a small set of hooks:
- Custom routing – By modifying
index.php, developers can add new query parameters or rewrite rules. - Webhooks – The redirect handler (
index.php?site=…) can be extended to trigger external callbacks (e.g., analytics services). - Plugin skeleton – While not a full plugin system, the
inc/directory can house additional PHP modules that are included at runtime. - API keys – Future forks could add an API key system for programmatic access, which would be trivial to implement given the existing routing logic.
Developer Experience
- Zero dependencies – No Composer, no Node.js. The entire project fits in a single Git repository with clear commit history.
- Documentation – The README covers installation, configuration, and web‑server rewrites; the code comments are minimal but consistent.
- Community – The project is dormant, but its simplicity invites forks; the original author welcomes improvements.
- Licensing – The repository is released under an MIT‑style license, allowing commercial use without attribution requirements.
Use Cases
- Internal Documentation – Teams can create short, human‑readable links to wiki pages or code snippets and annotate them with comments for quick reference.
- Marketing Campaigns – Developers can generate short URLs on‑the‑fly for A/B testing, attaching campaign identifiers as comments.
- Edge Deployment – Because it supports SQLite, the shortener can run on IoT gateways or local servers where a full MySQL installation is impractical.
- Educational Projects – Its bare‑bones architecture makes it an excellent teaching tool for PHP routing, session handling, and database CRUD operations.
Advantages Over Alternatives
| Criterion | Simple‑URL‑Shortener | Competitors (e.g., Shlink, YOURLS) |
|---|---|---|
| Footprint | < 50 KB PHP + assets | > 200 KB, often with Composer dependencies |
| Setup |
Open SourceReady to get started?
Join the community and start self-hosting Simple-URL-Shortener today
Related Apps in apis-services
Mastodon
Decentralized, real‑time social networking
Discourse
Open‑source community forum platform with real‑time chat and AI
Rocket.Chat
Secure, open‑source team communication platform
Novu
Unified notification platform for multi‑channel delivery
Mattermost
Secure, self‑hosted team collaboration with chat, voice, and AI
Jitsi Meet
Free, encrypted video conferencing for everyone
Weekly Views
Repository Health
Information
Explore More Apps

Neos
Open-source, developer-friendly CMS with event-sourced content and inline editing
BuddyPress
Turn WordPress into a social network
LinuxGSM
Command‑line tool for quick, simple game server management
FreeSWITCH
Open‑source telephony platform for any device
EPrints
Open-source digital repository platform for research
InspIRCd
Modular, lightweight IRC server for modern OSes