Permission Requirements
URL Tools require the
access.admin.panel permission. All routes are protected by authentication, email verification, and permission middleware.URL Tools Routes
Both tools are accessible from the admin panel:URL Shortener
Create short, memorable links for marketing campaigns and social media.Accessing the URL Shortener
Navigate to/admin/url-shortener to manage short URLs.
URL Shortener Features
Create Short Links
Generate short URLs for long destination links
Custom Slugs
Create memorable custom short codes
Link Management
View and manage all your short links
Click Tracking
Track click analytics for each link
Link Model
Short links are stored using the Link model:Creating Short URLs
Use the URL Shortener Livewire component to create links.Livewire URL Shortener Component
Use Cases for URL Shortener
Social Media Marketing
Social Media Marketing
Email Campaigns
Email Campaigns
Create trackable links for email marketing campaigns to measure engagement.
Print Materials
Print Materials
Use memorable short URLs on business cards, flyers, and print advertisements.
QR Codes
QR Codes
Generate QR codes from short URLs for offline-to-online marketing.
Affiliate Links
Affiliate Links
Mask and track affiliate URLs with branded short links.
URL Redirects
Manage URL redirects for SEO, site migrations, and broken link fixes.Accessing URL Redirects
Navigate to/admin/url-redirect to manage redirects.
URL Redirect Features
301 Redirects
Permanent redirects for moved content
302 Redirects
Temporary redirects for maintenance
Bulk Management
Manage multiple redirects efficiently
SEO Preservation
Maintain search engine rankings during migrations
Creating Redirects
Livewire URL Redirect Component
Redirect Types
301 vs 302 Redirects
- 301 Permanent: Use when content has permanently moved. Search engines transfer ranking signals to the new URL.
- 302 Temporary: Use for temporary changes, A/B testing, or maintenance. Search engines keep ranking signals on the original URL.
Use Cases for URL Redirects
Site Migration
Site Migration
Redirect old URLs to new structure when redesigning your site:
/blog/2024/01/post-title→/posts/post-title/products/category/item→/shop/item- Preserve SEO rankings and user bookmarks
Fixing Broken Links
Fixing Broken Links
Repair 404 errors found in search console:
- Monitor 404 errors in analytics
- Create redirects to relevant content
- Improve user experience
- Recover lost link equity
Domain Changes
Domain Changes
Redirect old domain to new domain:
- Set up domain-level redirects
- Preserve all SEO value
- Update DNS and hosting settings
- Monitor redirect chains
Content Consolidation
Content Consolidation
Merge similar content:
- Redirect duplicate pages to canonical version
- Combine thin content into comprehensive pages
- Eliminate keyword cannibalization
Campaign URLs
Campaign URLs
Create memorable campaign URLs:
/holiday-sale→/products?campaign=holiday2024/webinar→/events/register/webinar-title- Easy to remember and share
URL Management Workflows
Short URL Workflow
Redirect Management Workflow
Technical Implementation
Frontend Catch-All Route
Short URLs and redirects can use a catch-all route:The catch-all route is commented out by default to avoid conflicts with CMS dynamic pages. Enable it carefully based on your URL structure.
Link Resolution Priority
- Exact route matches (defined routes)
- Short URLs (if catch-all enabled)
- Redirects (if catch-all enabled)
- CMS dynamic pages
- 404 Not Found
Best Practices
Short URL Naming
Short URL Naming
Create effective short URLs:
- Keep slugs short (5-15 characters)
- Use lowercase letters and numbers
- Make them memorable and relevant
- Avoid confusing characters (0/O, 1/l)
- Consider your brand in the slug
Redirect Chains
Redirect Chains
Avoid redirect chains:
- Bad: A → B → C (multiple redirects)
- Good: A → C (direct redirect)
- Update old redirects when destinations change
- Regularly audit redirect paths
Testing Redirects
Testing Redirects
Always test before going live:
- Test in incognito/private browsing
- Verify HTTP status codes (301/302)
- Check mobile and desktop
- Test with and without trailing slashes
- Clear browser cache between tests
Documentation
Documentation
Document your URL strategy:
- Maintain a spreadsheet of all short URLs
- Document redirect mappings
- Note the reason for each redirect
- Track creation dates and campaign associations
Analytics Integration
Tracking Short URLs
Add UTM parameters to track campaign performance:Google Analytics Setup
- Configure Goals in Google Analytics
- Create Custom Campaigns with UTM parameters
- Monitor Short URL click-through rates
- Track conversion funnels from short URLs
Recommended Analytics Events
- Short URL clicks
- Redirect hits
- 404 errors
- Broken link reports
SEO Considerations
301 Redirect Impact
- Passes 90-99% of link equity
- Tells search engines the move is permanent
- Updates search results over time
- Required for site migrations
302 Redirect Impact
- Does not pass full link equity
- Search engines keep indexing the original URL
- Use for temporary changes only
- Good for A/B testing
Troubleshooting
Redirect Not Working
Redirect Not Working
If redirects aren’t working:
- Check the catch-all route is enabled
- Verify no conflicting routes exist
- Clear application cache:
php artisan cache:clear - Check route priority in
web.php - Test without browser cache
Redirect Loops
Redirect Loops
If you encounter redirect loops:
- Check destination doesn’t redirect back to source
- Review all redirects in the chain
- Ensure no circular dependencies
- Clear browser cache and cookies
- Test in incognito mode
Short URLs Conflict with Pages
Short URLs Conflict with Pages
If short URLs conflict with pages:
- Use a distinct prefix (e.g.,
/go/slug) - Move short URLs to subdomain (e.g.,
go.yoursite.com) - Carefully order routes in
web.php - Document reserved slugs
Wrong Redirect Type
Wrong Redirect Type
If you used the wrong redirect type:
- Update the redirect from 302 to 301 (or vice versa)
- Clear CDN cache if applicable
- Request re-crawl in Google Search Console
- Monitor search rankings for changes
Advanced Features
Bulk Redirect Import
For site migrations, consider building bulk import:Custom Short Domain
Use a custom domain for short URLs:- Register a short domain (e.g.,
ysite.co) - Point domain to your Laravel app
- Configure domain in settings
- Generate branded short links
Link Expiration
Add expiration dates to short URLs:- Set expiration date on creation
- Automatically disable expired links
- Redirect to fallback page after expiration
- Useful for time-sensitive campaigns
Security Considerations
Preventing Abuse
- Require authentication for link creation
- Implement CAPTCHA for public shorteners
- Monitor unusual click patterns
- Block malicious destination domains
- Set usage quotas per user
Performance Optimization
Caching Strategies
- Cache redirect mappings in Redis/Memcached
- Use route caching for production
- Implement CDN-level redirects for high traffic
- Pre-load common redirects
Database Optimization
- Index slug columns for fast lookups
- Archive old, unused redirects
- Paginate large redirect lists
- Use database query caching
Multi-Tenant Considerations
As a SaaS platform:- Tenant Isolation: Each tenant has separate short URLs and redirects
- Custom Domains: Support tenant-specific short domains
- Usage Limits: Enforce per-tenant link quotas
- Analytics: Provide tenant-level click analytics
- Branding: Allow custom short URL prefixes per tenant
Next Steps
Dashboard Overview
Return to the admin dashboard
Blog Management
Learn about content management