.htaccess Tester & Rule Generator
Build and test Apache web server configuration files. Enforce HTTPS, manage 301 redirects, block malicious IPs, enable Gzip compression, and verify routing behavior with the built-in request simulator.
Live Apache URL & IP Simulator
Core Redirects & Canonicalization
Performance & Security Modules
Custom Path Redirects (2)
Blocked IP Addresses (1 per line)
Apache RewriteEngine Architecture & Redirect Codes
Understanding Apache mod_rewrite Directives & Flags
The Apache HTTP Server rewrite module (mod_rewrite) rewrites requested URLs on the fly based on regular expression rules:
RewriteEngine On:Activates the runtime URL rewriting engine for the current directory scope and its children.RewriteCond:Defines a conditional predicate that must evaluate to true before the followingRewriteRulewill execute (e.g.%{HTTPS} off).[R=301,L]:Flags appended in brackets.R=301instructs the server to issue an HTTP 301 status redirect to the browser, whileL(Last) prevents further rewrite evaluation if this rule matches.[NC]:No Case flag, making the regular expression pattern case-insensitive.
HTTP 301 vs. HTTP 302: SEO & Caching Ramifications
Selecting the appropriate redirection status code is vital for search engine rankings and link equity preservation:
301 Moved Permanently
Passes 90–99% of PageRank link authority to the target URL. Browsers and search engine indexers cache 301 redirects aggressively. Ideal for permanent URL restructuring, domain rebranding, and HTTPS enforcement.
302 Found (Temporary)
Signals to web crawlers that the move is short-lived. Search engines retain the original URL in index rankings and do not transfer authority. Ideal for A/B testing, seasonal promotions, or temporary maintenance redirects.