.htaccess Password Generator - Online Apache Auth Creator
Generate encrypted passwords for .htaccess basic authentication. Create .htpasswd entries using bcrypt, MD5, or SHA. Server admin utility, local compute.
UD5 Toolkit
Generate mod_rewrite rules for your .htaccess file. Choose a template or build custom rewrite rules with conditions.
$1, $2 for back-references to captured groups. Use %{HTTP_HOST}, %{REQUEST_URI} for server variables. For absolute URLs, include the full URL like https://example.com$1.[OR] flag to change logic. Learn more Matches requests for old-page.html and internally rewrites them to /new-page.html. The [L] flag tells Apache to stop processing further rewrite rules after this one matches.
mod_rewrite is an Apache module that allows you to manipulate URLs using regular expressions. It works by intercepting incoming HTTP requests and applying pattern-matching rules defined in .htaccess files or Apache configuration. When a request URL matches a RewriteRule pattern, Apache transforms (rewrites or redirects) the URL based on the substitution you specify. Optional RewriteCond directives add conditions that must be satisfied before a rule is executed, giving you fine-grained control over when and how URLs are rewritten.
RewriteRule is the core directive that performs the actual URL transformation. It takes a regex pattern (matching the request path) and a substitution string. RewriteCond (Rewrite Condition) is an optional directive that precedes a RewriteRule and adds prerequisites. For example, a RewriteCond can check if the request is NOT coming from a specific host, or if a file does NOT exist on the server, before allowing the rule to execute. Multiple RewriteCond directives are combined with AND logic by default; use the [OR] flag to change this behavior.
Use a RewriteCond to check the %{HTTPS} variable and a RewriteRule to perform the redirect. Select the "Force HTTPS" template above, or manually configure:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
This checks if HTTPS is off and permanently redirects (301) to the HTTPS version while preserving the full URL path and query string.
The [L] (Last) flag tells Apache to stop processing any subsequent rewrite rules in the current context after the current rule matches. Without it, Apache continues evaluating later rules, which could unintentionally modify the URL further. However, note that in .htaccess files, the [L] flag does not completely stop all processing — Apache still re-injects the rewritten URL and starts the rule evaluation again from the top. This is why combining [L] with proper conditions is essential to avoid infinite redirect loops.
To hide .php extensions, you need two rules: one to internally rewrite clean URLs to the actual PHP files, and optionally another to externally redirect direct .php URLs to the clean version. Select the "Hide .php" template or use:
RewriteEngine On
# Internally rewrite /page to /page.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9_-]+)/?$ $1.php [L]
The RewriteCond checks if a corresponding .php file actually exists before rewriting, preventing 404 errors.
Debugging mod_rewrite can be challenging. Here are the most effective approaches:
RewriteLogLevel 3 in your config.LogLevel alert rewrite:trace3 to see detailed rewrite processing in the error log.Common pitfalls include:
RewriteEngine On — rules won't work without it.[L] and add exclusion conditions like RewriteCond %{ENV:REDIRECT_STATUS} ^$).. matches any character in regex; escape literal dots as \..^(.*)$ without anchoring — can match unexpected paths; always anchor with ^ and $.$1 and %1 back-references — $N refers to RewriteRule captures, %N refers to RewriteCond captures.An internal rewrite (no [R] flag) changes the URL server-side only — the visitor's browser address bar remains unchanged. This is used for clean URLs and framework routing. An external redirect (with [R=301] or [R=302]) sends a new URL back to the browser, which then makes a new request — the address bar updates. Use external redirects for SEO-critical URL migrations (301 permanent) and temporary moves (302). Use internal rewrites when you want friendly URLs without changing what the visitor sees.
Generate encrypted passwords for .htaccess basic authentication. Create .htpasswd entries using bcrypt, MD5, or SHA. Server admin utility, local compute.
Generate cryptographic key pairs using the Web Crypto API. Export as JWK or raw. No server needed; pure security.
Build a basic Nginx server block for a static site, reverse proxy, or PHP. Fill in the blanks and copy the config.
Get a clean, commented JS plugin skeleton with IIFE or ES module pattern. Start your new library faster.
Build an accessible modal using the native <dialog> element. Customize backdrop, content, and open/close logic. Copy the code.
Add columns with types and constraints, then generate a SQL CREATE TABLE statement. Supports MySQL/PostgreSQL.
Upload a logo to embed in the center of a QR code. High error correction so it still scans. Download PNG/SVG.
Fill in bio, skills, projects to generate a clean HTML portfolio page. Copy the code. Local builder.
Paste a list of URLs or texts and generate QR codes all at once. Download as individual images or a single sheet.
Generate a complete <head> section with meta charset, viewport, SEO, favicon, and social tags. Customize and copy.
Generate classic retro sound effects (coin, jump, explosion) using oscillators and noise. Play and download as WAV. Web Audio API fun.
Upload multiple SVGs and combine them into a single SVG sprite sheet with `<symbol>` and `<use>`. Fast icon system.
Generate random license keys or serial numbers in various formats (XXXX-XXXX-XXXX). Useful for software activation testing. Local generation.
Design a custom counter style with symbols, range, and speak‑as. Preview ordered lists with your new style. Export the CSS rule.
Write a function name and get a complete unit test stub with describe, it, and expect. Follows AAA pattern.
Generate random, secure coupon codes with a prefix. Choose length and character set. Perfect for store admins. All local.
Place rectangular pattern pieces on a virtual fabric width to optimize cutting layout and reduce waste. Simple manual drag & drop. Local only.
Enter a MIDI note number (0–127) or a musical note name and get the exact frequency in Hz. Piano keyboard picker.
Trim a video clip and convert it into an animated GIF. Adjust frame rate and size. Processing stays on your computer for privacy.
Select trip type (beach, business, camping) and get a pre-filled packing checklist. Customize and print. Local storage.
Generate the next sequential invoice number with optional prefix and date stamp. Keep track locally or export.
Design custom unordered and ordered lists with images, strings, or counters. Preview and copy the CSS.
Convert Unix timestamps to human-readable dates and vice versa. Supports seconds and milliseconds. Ideal for developers debugging time-related code.
Convert between square meters, square feet, acres, hectares, and more. Essential for real estate and land measurements. Instant results, private data.
Convert an SVG shape into a CSS mask‑image. Transparent regions become masked. Great for custom image crops. Client‑side.
Run multiple named timers simultaneously for cooking. Presets like pasta, rice, etc. Audio alarm. Works in background.
Design a custom analog clock face by choosing colors, hands, and numbers. Download as SVG or PNG. For craft or UI design.
Fill in container image and ports. Generate a Deployment and Service YAML with best practices. Start your K8s journey.
Record audio from your microphone and export as a WAV file. Monitor levels. Processed entirely in your browser.
Record audio from your microphone and export as a WAV file. Monitor levels. Processed entirely in your browser.