⚙️

Validate .htaccess Syntax & Catch Errors Instantly (Apache Rules)

Lint Apache .htaccess files for syntax errors, unclosed block tags, and common misconfigurations. Detects RewriteRule issues, invalid status codes, deprecated access directives, and unclosed IfModule blocks. Free and runs entirely in your browser.

ValidatorsDevOps & Infrastructure
Loading tool...

How to Use .htaccess Validator

How to Use .htaccess Validator

Step 1: Paste Your .htaccess Content

Copy the full content of your .htaccess file and paste it into the input field. You can also load one of the built-in examples.

Step 2: Click Validate .htaccess

The tool checks:

  • Unclosed block tags<IfModule>, <Files>, <FilesMatch>, <Directory>, etc. must be properly closed
  • RewriteEngine missing — RewriteRule and RewriteCond require RewriteEngine On to take effect
  • Invalid status codes — ErrorDocument must use a valid 4xx or 5xx HTTP code; Redirect codes must be 301, 302, 303, 307, or 308
  • Deprecated directivesOrder, Allow, and Deny are deprecated in Apache 2.4+ in favour of Require
  • RewriteRule flag codes — validates [R=xxx] redirect codes in rule flags
  • Unknown directives — flags unrecognised directive names that may be typos

Step 3: Review Results

Stats grid — line count, directive count, block sections, rewrite rules, redirects, and headers at a glance.

Errors — issues that will cause rules to fail or Apache to reject the file.

Warnings — non-breaking issues like deprecated directives or unusual patterns.

Block Sections — all detected <IfModule>, <Files>, and other container blocks with their arguments.

Rewrite Rules & Conditions — all RewriteRule and RewriteCond lines for review.

Tips

  • Always place RewriteEngine On before any RewriteRule or RewriteCond directive
  • Every opening <IfModule> must have a matching </IfModule> on its own line
  • Test .htaccess changes on a staging server — a syntax error can take down your entire site
  • Use php_value and php_flag only if PHP runs as an Apache module (not FPM or CGI)
  • Avoid Order/Allow/Deny in Apache 2.4+ — use Require all denied or Require all granted instead

Frequently Asked Questions

Most Viewed Tools

🔐

TOTP Code Generator

3,032 views

Generate time-based one-time passwords from a TOTP secret key. Enter your base32 secret, choose a period and digit length, and get the current and next codes with a live countdown timer. Useful for testing and debugging 2FA integrations.

Use Tool →
{ }

JSON to Zod Schema Generator

3,014 views

Generate Zod validation schema code from a JSON sample object. Infers z.string(), z.number(), z.boolean(), z.array(), z.object(), and z.null() types automatically. Handles nested objects, arrays of objects with optional field detection, and outputs copy-ready TypeScript with import and z.infer type alias.

Use Tool →
{}

JSONL / NDJSON Formatter

2,941 views

Format, validate, and inspect JSON Lines (JSONL) and NDJSON files. Validates each line individually, reports parse errors by line number, outputs compact JSONL or a pretty-print preview, and lets you download the cleaned file.

Use Tool →
🔐

TLS Cipher Suite Checker

2,560 views

Check TLS protocol version compatibility and cipher suite strength ratings against current best practices. Supports IANA and OpenSSL cipher names — rates each suite as Strong, Weak, or Deprecated and explains why.

Use Tool →
🔍

Secret and Credential Scanner

2,550 views

Scan pasted text, code, or config files for accidentally exposed API keys, tokens, passwords, and private keys. Detects 50+ secret types across AWS, GitHub, Stripe, OpenAI, and more — all client-side, nothing leaves your browser.

Use Tool →
🔑

Password Entropy Calculator

2,516 views

Calculate the information-theoretic bit entropy of any password or API key. Detects character set pools automatically, shows the total number of possible combinations, and estimates crack time across five attack scenarios from rate-limited web logins to GPU cracking clusters.

Use Tool →

TOML Config Validator

2,284 views

Validate TOML configuration file syntax and report errors with line numbers. Paste any TOML content — Cargo.toml, pyproject.toml, config.toml — and instantly see a green checkmark with key counts and structure stats, or a precise error message pointing to the exact line. Includes a collapsible JSON structure preview to confirm what was parsed.

Use Tool →
🔒

Content Security Policy Generator

2,139 views

Build Content Security Policy headers interactively. Toggle directives like script-src, style-src, and img-src, select allowed source tokens, and add custom origins. Instantly outputs your CSP as an HTTP header, meta tag, Nginx directive, or Apache header.

Use Tool →

Related DevOps & Infrastructure Tools

🍪

Cookie Parser

Parse HTTP cookie strings into readable key-value pairs. Decode URL-encoded values and inspect cookies from browser requests.

Use Tool →
📋

API Response Formatter

Format and beautify API responses for better readability. JSON formatter with minify and prettify options.

Use Tool →
🔍

HTTP Header Analyzer

Parse and analyze HTTP request or response headers. Identifies categories, explains each header, flags missing security headers, and detects duplicates or suspicious values — entirely in your browser.

Use Tool →
🔗

Query String Parser

Parse URL query strings into readable key-value pairs. Decode parameters and inspect URL search queries with ease.

Use Tool →
🤖

robots.txt Validator

Validate your robots.txt file against the Robots Exclusion Protocol. Checks directive syntax, path formats, Crawl-delay values, and Sitemap URLs. Previews crawl rules per user-agent group. Free and runs entirely in your browser.

Use Tool →
🔒

SSL Certificate Validator

Paste a PEM certificate to instantly validate expiry, signature algorithm, key strength, SAN presence, and trust chain. Get a clear pass/warn/fail report for each check.

Use Tool →
🔍

User Agent Parser

Parse user agent strings to extract browser, operating system, device, and engine information. Essential for web analytics, device detection, and browser compatibility testing.

Use Tool →

Cron Expression Validator

Validate cron expressions, get a plain-English explanation of what they mean, and see the next scheduled run times — all in your browser.

Use Tool →

Share Your Feedback

Help us improve this tool by sharing your experience

We will only use this to follow up on your feedback