Redirect Code Generator
Generate redirect code for multiple platforms including Apache (.htaccess), Nginx, JavaScript, and meta refresh. Create 301 and 302 redirects easily.
Apache (.htaccess)
# Enter source and destination URLs
Nginx
# Enter source and destination URLs
Meta Refresh
<!-- Enter destination URL -->
JavaScript
// Enter destination URL
When to Use Each Type
- Apache (.htaccess): Most shared hosting and Apache servers
- Nginx: Nginx web servers, often used for high-traffic sites
- Meta Refresh: Last resort when you don't have server access
- JavaScript: Client-side only, not recommended for SEO
How to Use This Tool
Enter the source URL path (e.g., /old-page/).
Enter the destination URL (where to redirect to).
Select the redirect type (301 permanent or 302 temporary).
Copy the appropriate code for your server type.
Add the code to your server configuration file.
Frequently Asked Questions
Everything you need to know about our services
What's the difference between 301 and 302 redirects?
301 redirects are permanent, indicating the page has moved forever and passing most SEO value. 302 redirects are temporary, for short-term moves. Use 301 for permanent URL changes to preserve SEO rankings.
Where do I add .htaccess redirects?
Add redirect rules to the .htaccess file in your website's root directory. If the file doesn't exist, create it. The file should be named exactly '.htaccess' with the leading dot.
Are JavaScript redirects good for SEO?
No, JavaScript redirects are not recommended for SEO as search engines may not follow them consistently. Use server-side redirects (301/302) whenever possible for SEO benefits.
More Free Tools
Need More Than Just Tools?
Our SEO experts can help you implement comprehensive strategies that drive real results. Get a free consultation today.
Get Your Free Strategy Session