fLINK Logo

fLINK

Production-Ready URL Redirect Service

fLINK is a simple URL redirect service that makes it easy to manage short links, track campaigns, and handle domain migrations. Configure redirects via file, URL, or environment variables, connect your analytics tools, and get instant updates without restarts. Perfect for QR codes, marketing links, and SEO-preserving migrations.

Why You Need URL Redirects

SEO & Domain Migration

Moving to a new domain? Preserve years of SEO work with proper 301 redirects that maintain your search rankings.

Branded Short Links

Create memorable links like go.company.com/demo instead of sharing long, complex URLs.

Track External Sites

Connect to Matomo or other analytics tools to track clicks to external sites you don't control.

Dynamic QR Codes

Print QR codes once, update destinations forever. Perfect for menus, brochures, and packaging.

Marketing Campaigns

Track Google Ads, Facebook, and email campaigns. Full UTM support with automatic click ID preservation.

Instant Updates

Change redirect destinations instantly. File changes detected in 5 seconds, remote configs refresh every 10 minutes.

Get Started in 60 Seconds

Choose your preferred configuration method:

# Using environment variables for inline mappings docker run -d -p 80 -e PORT=80 \ -e REDIRECT_MAPPINGS="shop=https://store.com;docs=https://docs.com" \ funktionslust/flink:latest # Or use a configuration file docker run -d -p 80 -e PORT=80 \ -e REDIRECT_MAPPINGS=/app/redirects.txt \ -v ./redirects.txt:/app/redirects.txt \ funktionslust/flink:latest

Quick start with environment variables or file-based configuration.

./flink \ -mappings "shop=https://store.com;docs=https://docs.com" \ -port 80

Direct execution with command-line flags for all options.

# Set environment variables and run export REDIRECT_MAPPINGS="shop=https://store.com;docs=https://docs.com" export PORT=80 ./flink # Or use multiple redirect mappings export REDIRECT_MAPPINGS="shop=https://store.com;docs=https://docs.com;api=https://api.company.com" export FORWARD_QUERY_PARAMS=true ./flink

Quick start with environment variables or file-based configuration.

# redirects.txt shop=https://store.com docs=https://docs.com blog=https://medium.com/@company # Using named redirect types old-page=https://new.com/page,permanent temp-maintenance=https://status.com,temporary # Wildcard patterns for bulk redirects api/v1/*=https://v1.api.com/* blog/*=https://newsite.com/articles/*,permanent # Wildcard to fixed destination (no wildcard on right) legacy/*=https://newsite.com/archived-content # Run with file ./flink -mappings redirects.txt -port 80

File-based configuration with automatic hot-reloading on changes.

# Load configuration from URL ./flink -mappings https://config.example.com/redirects.txt -port 80 # Auto-refreshes every 10 minutes

Centralized configuration management via HTTP/HTTPS.

Your redirects are immediately available at http://localhost/shop and http://localhost/docs

Features

Sub-millisecond latency (7-18μs)
Zero-downtime config updates
Smart UTM & click ID tracking
Multi-site Matomo analytics
Automatic QR code generation
Configurable query forwarding

Real-World Configuration

SEO-Friendly Domain Migration

# Preserve search rankings with 301 permanent redirects old-home=https://newsite.com,permanent old-products=https://newsite.com/shop,status=301 # Bulk migration with wildcards old-blog/*=https://newsite.com/articles/*,permanent old-docs/*=https://docs.newsite.com/*,permanent

Marketing Campaign Tracking

services: flink: image: funktionslust/flink:latest environment: - REDIRECT_MAPPINGS=/app/redirects.txt - MATOMO_URL=https://analytics.example.com - MATOMO_TOKEN_FILE=/run/secrets/matomo_token - FORWARD_QUERY_PARAMS=true # Forward UTM parameters volumes: - ./redirects.txt:/app/redirects.txt # Automatically tracks: # • UTM parameters (campaign, source, medium, term, content) # • Click IDs (gclid, fbclid, msclkid) # • Custom tracking parameters

Frequently Asked Questions

How do I update redirects without downtime?

Just edit your configuration - fLINK detects changes automatically. File changes are detected within 5 seconds, remote configs refresh every 10 minutes. No restarts, no downtime.

Can I use wildcards or regex in paths?

Yes! fLINK supports wildcard patterns using * at the end of paths. For example, blog/*=https://new.com/posts/* redirects all blog paths to the new location while preserving the path suffix. More specific patterns take precedence over general ones.

What's the performance like?

Redirects are served from memory with sub-millisecond response times (7-18 microseconds in production). The Go implementation ensures excellent performance and low resource usage.

Can I use both 301 and 302 redirects?

Yes! Use ,permanent or ,status=301 for permanent redirects (SEO-friendly) or ,temporary or ,status=302 for temporary redirects. Also supports 303, 307, and 308 status codes.

How are query parameters handled?

By default, all query parameters are forwarded to the destination URL. This includes UTM parameters, click IDs (gclid, fbclid), and custom parameters. You can disable this with FORWARD_QUERY_PARAMS=false.

Why not use nginx or .htaccess for redirects?

fLINK updates instantly without server restarts, integrates with analytics tools like Matomo, generates QR codes automatically, and doesn't require web server expertise. It's purpose-built for redirect management.

Can I track campaigns on sites I don't control?

Yes! fLINK integrates with Matomo to track redirect events with full UTM parameters and click IDs, even when the destination site doesn't have your analytics. Google Analytics support coming soon.

How do QR codes work?

Add /qr to any redirect path: yoursite.com/menu/qr returns a QR code image. The destination can be updated anytime without reprinting.

Is it secure?

Yes. Input validation prevents injection and path traversal attacks, runs as non-root in Docker, supports secrets management, trusted proxy validation, and doesn't execute any user-provided code.

Does it preserve the original referer?

Yes, HTTP redirects naturally preserve the original referer header. The destination sees where visitors originally came from, not your redirect server.

What about GDPR/privacy?

fLINK itself stores no user data or logs. Analytics tracking is optional and uses your own Matomo instance. It respects X-Forwarded-For headers for accurate visitor tracking.

What happens if my remote config URL is down?

fLINK continues using the last successfully loaded configuration. It attempts to refresh every 10 minutes but won't break if the config source is temporarily unavailable.

Can I use wildcards or regex in paths?

Yes! fLINK supports wildcard patterns using * at the end of paths. For example, blog/*=https://new.com/posts/* redirects all blog paths to the new location while preserving the path suffix. More specific patterns take precedence over general ones.

How do I integrate with Matomo?

Set MATOMO_URL and MATOMO_TOKEN environment variables. fLINK will automatically track all redirects, including UTM parameters and referrer information.

What's the difference between file and URL configuration?

File configs are watched for changes every 5 seconds - perfect for local development. URL configs refresh every 10 minutes - ideal for centralized management across multiple instances.

Planned Features

Internal Redirect Mode

Forward requests internally without exposing the destination URL, perfect for reverse proxy scenarios and maintaining clean URLs.

Google Analytics Integration

Native support for Google Analytics 4, including event tracking, conversion goals, and e-commerce data.

Management API

RESTful API with bearer token authentication for retrieving loaded rules, triggering configuration rescans, and health checks.