# phanan/htaccess

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/phanan-htaccess).**

13,165 stars · 1,292 forks · NOASSERTION

## Links

- GitHub: https://github.com/phanan/htaccess
- awesome-repositories: https://awesome-repositories.com/repository/phanan-htaccess.md

## Topics

`apache` `awesome` `awesome-list` `dev-ops` `htaccess` `htaccess-snippets` `list` `snippets`

## Description

This project is a comprehensive library of reusable configuration patterns for the Apache web server. It provides a collection of server-side directives designed to manage security, performance, and request routing through decentralized configuration files.

The repository serves as a reference for implementing server-level settings without requiring global restarts. It includes specialized patterns for enforcing secure connections, managing cross-origin resource sharing, and protecting sensitive system files from public exposure. Users can leverage these snippets to implement clickjacking protection, configure custom error pages, and define access restrictions based on IP addresses or user agents.

Beyond security, the library covers traffic management and asset optimization. It provides rules for URL canonicalization, clean URL rewriting, and browser caching strategies to improve site performance. The collection also includes directives for automated media format delivery and MIME type mapping to ensure consistent asset handling across different browser environments.

## Tags

### Repository Format

- [Awesome List](https://awesome-repositories.com/f/repository-format/awesome-list.md) — A community-curated directory that catalogs and links out to other open-source projects, rather than a standalone tool you run yourself.

### Part of an Awesome List

- [Server Configuration](https://awesome-repositories.com/f/awesome-lists/devops/server-configuration.md) — Provides a comprehensive collection of configuration snippets for managing Apache server settings and request handling. ([source](https://github.com/phanan/htaccess#readme))
- [DevOps and Infrastructure](https://awesome-repositories.com/f/awesome-lists/devops/devops-and-infrastructure.md) — Collection of configuration snippets for web server optimization.
- [Infrastructure and Automation](https://awesome-repositories.com/f/awesome-lists/devops/infrastructure-and-automation.md) — Configuration resources for Apache web server files.
- [Back End Development](https://awesome-repositories.com/f/awesome-lists/devtools/back-end-development.md) — Listed in the “Back End Development” section of the Awesome awesome list.
- [Developer Tools](https://awesome-repositories.com/f/awesome-lists/devtools/developer-tools.md) — .htaccess configuration snippets.
- [URL Management](https://awesome-repositories.com/f/awesome-lists/devtools/url-management.md) — Manages website traffic through URL redirects, canonical domain enforcement, and clean URL structures.

### DevOps & Infrastructure

- [HTTP Server Directives](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/server-and-site-configuration/http-server-directives.md) — Implements decentralized server-level directives for controlling request handling and performance without global restarts.

### Security & Cryptography

- [Access Restrictions](https://awesome-repositories.com/f/security-cryptography/access-restrictions.md) — Implements server-level access control by filtering requests based on IP addresses, user agents, or referrer domains. ([source](https://github.com/phanan/htaccess#readme))
- [HTTP Security Headers](https://awesome-repositories.com/f/security-cryptography/http-security-headers.md) — Serves as a reference for implementing security headers to mitigate common web vulnerabilities.
- [Secure Connection Handlers](https://awesome-repositories.com/f/security-cryptography/secure-connection-handlers.md) — Enforces encrypted connections by redirecting insecure traffic to secure endpoints. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Security Headers](https://awesome-repositories.com/f/security-cryptography/security-headers.md) — Applies security-focused HTTP response headers to mitigate common web vulnerabilities. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Clickjacking Protections](https://awesome-repositories.com/f/security-cryptography/clickjacking-protections.md) — Provides configuration patterns to prevent web pages from being rendered within unauthorized frames or iframes. ([source](https://github.com/phanan/htaccess/tree/2.2))
- [Cross-Origin Resource Sharing Policies](https://awesome-repositories.com/f/security-cryptography/cross-origin-resource-sharing-policies.md) — Defines security policies for managing cross-origin resource sharing and asset loading permissions. ([source](https://github.com/phanan/htaccess#readme))
- [Administrative Interface Access Controls](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/network-interface-access/administrative-interface-access-controls.md) — Restricts directory access and protects sensitive system files through server-level configuration rules.
- [Sensitive File Protections](https://awesome-repositories.com/f/security-cryptography/security/policies/host-resource-access/file-system-access-controls/sensitive-file-protections.md) — Blocks public access to hidden files, configuration files, and source code backups. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Directory Authentication](https://awesome-repositories.com/f/security-cryptography/directory-authentication.md) — Enforces credential-based access requirements for specific directories or sensitive files on the server. ([source](https://github.com/phanan/htaccess/tree/2.2))
- [Access Control](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control.md) — Enforces access control policies by evaluating request metadata like IP addresses and user agents.
- [Security Header Injections](https://awesome-repositories.com/f/security-cryptography/network-infrastructure-security/web-network-security/web-security-policies/security-header-injections.md) — Appends security and caching instructions to HTTP responses to enforce browser-side policies.

### Web Development

- [Web Security Hardening](https://awesome-repositories.com/f/web-development/web-security-hardening.md) — Hardens web security by implementing HTTP headers and access restrictions against common vulnerabilities.
- [Clean URL Rewriting](https://awesome-repositories.com/f/web-development/clean-url-rewriting.md) — Maps user-friendly, extensionless URLs to underlying script files to improve readability. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Caching Header Optimizers](https://awesome-repositories.com/f/web-development/backend-development/request-response-handling/http-utilities/http-header-manipulators/caching-header-optimizers.md) — Configures cache control and expiration headers to optimize browser-side asset storage. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Canonical Domain Enforcements](https://awesome-repositories.com/f/web-development/canonical-domain-enforcements.md) — Redirects traffic between www and non-www versions of a domain to ensure consistent URL structures. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [URL Normalization Utilities](https://awesome-repositories.com/f/web-development/url-normalization-utilities.md) — Standardizes request paths by enforcing consistent URL formatting and removing trailing slashes. ([source](https://github.com/phanan/htaccess/tree/2.2))
- [URL Redirections](https://awesome-repositories.com/f/web-development/url-routing/redirection-rules/geographic-redirection/url-redirections.md) — Forwards requests for specific pages or directories to new locations while preserving path structures. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
- [Regex-Based URL Dispatchers](https://awesome-repositories.com/f/web-development/routing-systems/routing/matching-algorithms/regex-based-url-dispatchers.md) — Maps incoming URL patterns to internal file paths using regular expression matching logic.

### Software Engineering & Architecture

- [Static Asset Optimization Pipelines](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/build-bundle-optimization/static-asset-optimization-pipelines.md) — Optimizes website performance by configuring browser caching and expiration headers for static assets.

### Networking & Communication

- [Declarative Traffic Rules](https://awesome-repositories.com/f/networking-communication/declarative-traffic-rules.md) — Provides structured rule sets for transforming request URIs into internal resource locations via Apache rewrite directives.

### System Administration & Monitoring

- [Directory Browsing Controls](https://awesome-repositories.com/f/system-administration-monitoring/directory-browsing-controls.md) — Prevents the server from listing directory contents to hide internal file structures. ([source](https://github.com/phanan/htaccess/blob/master/README.md))
