Skip to main content

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

PageURL
Shortlink Management/admin/shortlinks
Domain Management/admin/shortlinks/domains
1

Open Shortlinks

Go to /admin/shortlinks
2

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:
MetricDescription
Total ClicksOverall click count
CountriesGeographic distribution
DevicesDesktop, mobile, tablet breakdown
ReferrersWhere clicks came from
BrowsersBrowser usage stats
Export analytics to CSV for further analysis.

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:
Name: link
Value: yourdomain.com
TXT Record (for verification):
Name: _shortlink-verify.link
Value: [verification token shown in dashboard]
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

{
  customPath: "winter-sale",
  destinationUrl: "https://example.com/products?utm_source=...",
  previewImageUrl: "https://...",
  title: "Winter Sale 2024",
  description: "50% off all items",
  isActive: true,
  clickCount: 150,
  createdAt: "2024-01-01T00:00:00Z"
}
{
  shortlinkId: "abc123",
  timestamp: "2024-01-15T10:30:00Z",
  country: "US",
  countryName: "United States",
  deviceType: "mobile",
  browser: "Chrome",
  referrer: "https://twitter.com"
}

Collision Detection

The system automatically checks if your custom path conflicts with:
  • Existing blog posts
  • Project pages
  • Static routes
  • Other shortlinks
A warning appears if a collision is detected.

Best Practices

Use descriptive paths like winter-sale instead of random strings for better memorability.
Add preview images to increase click-through rates by 30-50% on social media.
Shortlinks are case-insensitive. My-Link and my-link are the same.