WebTools

307 Useful Tools & Utilities to make life easier.

HTACCESS Redirect Generator

Generate HTACCESS Redirects

Enter the path you want to redirect from (e.g., /old-page)
Enter the destination path or full URL.
Redirects all HTTP traffic to secure HTTPS.

Generated .htaccess Code

Copy the generated code below into your .htaccess file.

Master Your Apache Server Without Touching Command Line

The .htaccess file is a powerful configuration file used on Apache web servers. With it, you can create 301 redirects, rewrite URLs, set caching headers, enable gzip compression, block bad bots, force HTTPS, set custom error pages, and implement security measures like password protection and hotlink blocking. But one typo can bring your site down with a 500 Internal Server Error. Our Htaccess Generator provides a safe, form‑driven interface to build complex rulesets. You select what you want to do, fill in the parameters, and the tool writes syntactically perfect code that you can drop into your .htaccess.

Rules You Can Generate Visually

  • Redirects: 301 (permanent) and 302 (temporary). Redirect single page, entire directory, or domain. Choose to redirect with or without query strings. The generator creates the Redirect or RewriteRule appropriately.
  • URL Rewriting: Hide .html or .php extensions, create clean URLs (e.g., /product/123 → /product.php?id=123). The tool builds RewriteCond and RewriteRule lines.
  • Force HTTPS: Ensure all traffic goes to https://. Optionally force www or non‑www canonical domain.
  • Security headers: Set X-Frame-Options (DENY/SAMEORIGIN), X-Content-Type-Options: nosniff, Referrer-Policy, and Content-Security-Policy basics.
  • Caching: Set ExpiresByType for images, CSS, JavaScript, and HTML with custom durations (days, months).
  • Gzip compression: Add AddOutputFilterByType DEFLATE rules for text‑based files to reduce bandwidth.
  • Hotlink protection: Prevent other sites from embedding your images.
  • Custom error pages: Point ErrorDocument 404 /error/404.html to a friendly page.
  • Blocking: Deny access by IP, or block specific user‑agents (bad bots).
  • WWW redirect: Redirect example.com to www.example.com or vice versa.

Step‑by‑Step: Build Your .htaccess

  1. Start from a template or a blank slate. The interface is tabbed: Redirects, Rewrites, Security, Caching, etc.
  2. Add a redirect: Pick “301 Redirect.” Enter the old path (/old-page) and the new URL (https://yoursite.com/new-page). The tool writes the rule.
  3. Force HTTPS: Go to the Security tab, toggle “Force HTTPS,” and choose WWW preference.
  4. Add caching: In the Caching tab, set ExpiresByType text/css "access plus 1 month", etc. The tool provides presets.
  5. Review the accumulating code in the live preview. It’s color‑coded and comments are added for clarity.
  6. Check for conflicts. The generator warns if a redirect and a rewrite might overlap.
  7. Copy or download the .htaccess file. Upload it to your site’s root directory (or a subdirectory). Test immediately.

Proceed with Caution

Always backup your existing .htaccess before replacing it. After uploading, test your site thoroughly. For major changes, consider editing on a staging site first.

Complement with Other Server Tools

If you need to convert your rules to Nginx format, use the Htaccess to Nginx converter. For the opposite, Nginx to Htaccess. To protect specific directories with a password, the HTTP Auth Generator creates the necessary .htpasswd rules. For SEO, ensure your redirects are correct using the Redirect Checker. Crawl your site with the Site Crawler to verify no broken links after changes. Monitor compression with the Gzip Test. These tools together give you full control over your server’s behaviour, directly impacting site speed and SEO.


Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us