Shortlink System
A comprehensive URL shortening solution with analytics and custom domain support.Features
- Create short URLs from long URLs
- Custom paths (e.g.,
yoursite.com/my-link) - Preview images for social media
- Click analytics (countries, devices, referrers)
- Custom domain support
- Collision detection with existing routes
Admin URL
| Page | URL |
|---|---|
| Shortlink Management | /admin/shortlinks |
| Domain Management | /admin/shortlinks/domains |
Creating a Shortlink
1
Open Shortlinks
Go to
/admin/shortlinks2
Click Create
Click Create Shortlink
3
Enter URL
Paste the long destination URL
4
Choose Path
- Auto-generate: Random short path
- Custom: Enter your own (e.g.,
winter-sale)
5
Optional: Preview Image
Upload an image for social media previews
6
Create
Click Create Shortlink
Analytics
Click the analytics icon on any shortlink to view:| Metric | Description |
|---|---|
| Total Clicks | Overall click count |
| Countries | Geographic distribution |
| Devices | Desktop, mobile, tablet breakdown |
| Referrers | Where clicks came from |
| Browsers | Browser usage stats |
Custom Domains
Setup Steps
1
Add Domain
Go to Domain Management → Add Domain
Enter subdomain (e.g.,
link.yourdomain.com)2
Configure DNS
Add these records in your DNS provider:CNAME Record:TXT Record (for verification):
3
Verify
Wait 5-10 minutes for DNS propagation, then click Verify DNS
4
Use
Select the custom domain when creating new shortlinks
Database Schema
shortlinks Collection
shortlink_analytics Collection
Collision Detection
The system automatically checks if your custom path conflicts with:- Existing blog posts
- Project pages
- Static routes
- Other shortlinks