Tools / htaccess Redirect Generator
htaccess Redirect Generator
Free .htaccess redirect generator for Apache and cPanel. Build 301 and 302 mod_rewrite rules, force HTTPS and pick a canonical www host.
Paste this near the top of the .htaccess file in your site root, above any WordPress or framework block. Back up the original file first.
Frequently asked questions
Where do these rules go?
Near the top of the .htaccess file in your site root, above any WordPress or framework block, because the first matching redirect wins. Back up the original file before you paste anything in.
301 or 302?
Use 301 when the move is permanent — it passes ranking signals and gets cached by browsers. Use 302 for temporary moves such as a campaign page or a short maintenance detour.
Can I redirect a URL with a query string?
Yes. Paste the full path including `?id=12` and the generator adds a matching RewriteCond, then appends a trailing `?` to the target so the old query string is not carried over.
Do I need to enter my domain?
No. The HTTPS and www rules use Apache's own %{HTTP_HOST} variable, so the same block works on staging and production without edits.
Why is everything wrapped in IfModule?
If mod_rewrite is disabled on the server, an unguarded RewriteEngine line returns a 500 error. The IfModule wrapper makes the block inert instead.
Let's build something you're proud of
I help businesses launch, optimize and maintain their online presence, from code to SEO.
Let's talkRelated tools
Image Resizer and Compressor
Free online image resizer and compressor. Resize photos, convert to WebP or JPEG and shrink file size in your browser, with no upload.
robots.txt Generator
Free robots.txt generator. Build user-agent groups with allow and disallow rules, add a sitemap, block AI crawlers and copy the file.
Cron Expression Explainer
Free cron expression explainer. Translate a five-field crontab line into plain English and preview the next scheduled runs in your browser.
CSS Gradient and Shadow Generator
Free CSS gradient and box-shadow generator. Build linear or radial gradients and layered shadows with a live preview, then copy the CSS.
Color Contrast Checker
Free WCAG color contrast checker. Test text against background colors, see the contrast ratio and AA/AAA results, and get an accessible color suggestion.
Regex Tester
Free online regular expression tester. Try JavaScript regex patterns with flags, see match indexes and groups, and preview replacements in your browser.
CSV ↔ JSON Converter
Free online CSV to JSON and JSON to CSV converter. Parse quoted fields, choose comma, semicolon or tab delimiters and convert locally in your browser.
UUID / ULID Generator
Free online UUID and ULID generator. Create one or many UUIDv4 or ULID values in your browser with optional uppercase output and no signup.
Text Diff
Free online text diff and compare tool. Compare two texts line by line with added, removed and unchanged highlighting. Runs in your browser with no upload.
Unix Timestamp Converter
Free online Unix timestamp converter. Convert epoch seconds or milliseconds to local and UTC dates, or turn a date into a Unix timestamp in your browser.
Case Converter
Free online case converter. Switch text between lowercase, UPPERCASE, Title Case, snake_case, kebab-case, camelCase and PascalCase in your browser.
QR Code Generator
Free online QR code generator. Create a PNG QR code from a URL or text in your browser, then download it. No signup and no upload.
Duplicate Detector
Free online duplicate line finder. Detect repeated lines, remove duplicates, or count frequencies in lists and logs. Runs in your browser with no upload.
Image to Base64 Converter
Free online image to Base64 and Base64 to image converter. Convert PNG, JPEG, WebP, or GIF in your browser with no upload.
Password Generator
Free online password generator. Create strong random passwords with custom length, letters, numbers, symbols and optional ambiguous-character exclusion.
Random Number Generator, Picker & Shuffler
Free online random number generator, list picker and shuffler. Generate a random integer, pick one item from a list, or shuffle lines.
URL Encoder and Decoder
Encode and decode URL strings online. Free percent-encoding tool for query parameters, slugs and full URLs.
Base64 Encoder and Decoder
Encode and decode Base64 strings online. Free Base64 converter that supports Unicode text, API tokens and data URLs.
Meta Tag Generator
Generate SEO meta tags, Open Graph and Twitter Card markup for your pages. Free online meta tag builder with live preview.
JSON Formatter and Validator
Format, minify and validate JSON online. Free JSON beautifier with syntax error messages for debugging APIs and config files.
Pixels to Ems Conversion
Convert pixels to ems and ems to pixels based on base font size. Free px to em calculator for responsive CSS.
Table Generator
Generate HTML table code from rows and columns. Free online table generator with copy-to-clipboard for web projects.
HEX to RGB to HSL Conversion
Convert colors between HEX, RGB and HSL formats instantly. Free online color converter for CSS and design work.
CSS Minifier and Beautifier
Minify CSS to reduce file size or beautify CSS for readable formatting. Free online CSS tool for developers.
HTML Minifier and Beautifier
Minify or beautify HTML online. Remove whitespace and comments to reduce file size, or format code for readability.