Apache .htaccess 生成器 —— HTTPS 跳转、www 切换、Gzip、缓存头、防盗链。
- 本地处理
- 分类 生成器
- 适合 从空白开始,先拿到一版可修改的结果。
www 规范化
屏蔽的 User-Agent
目录列表
<IfModule mod_rewrite.c>
RewriteEngine On
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Strip www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]
</IfModule>
<IfModule mod_deflate.c>
# Gzip compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
AddOutputFilterByType DEFLATE application/javascript application/json application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml
AddOutputFilterByType DEFLATE image/svg+xml font/woff font/woff2 application/font-woff
</IfModule>
<IfModule mod_expires.c>
# Browser cache (mod_expires)
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType application/json "access plus 0 seconds"
</IfModule>
# Custom error pages
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
# Directory listing off
Options -Indexes这个工具能做什么
免费的 Apache .htaccess 配置生成器。勾选你要的功能块:强制 HTTPS、 选择规范域名(强制 www 或去掉 www)、用 mod_deflate 启用 Gzip、用 mod_expires 按 mimeType 设浏览器缓存周期、按 Referer 防盗链、替换 自定义 404 / 500 / 503 错误页、屏蔽恶意 User-Agent、控制目录列表 显示与否、按需打开 CORS 跨域。点选即实时重建输出,每条规则附中文 注释方便阅读。一键复制或直接下载文件。100% 浏览器本地运行:内容 不上传、不走任何外部接口。
工具细节
- 输入
- 文件 + 文本 + 数值
- 页面会根据工具类型展示文本框、数值控件、文件选择或结构化输入。
- 输出
- 即时结果 + 复制 + 下载
- 结果区优先给出可操作结果,支持项会显示复制、下载或可视化预览。
- 隐私
- 浏览器本地处理
- 主工具逻辑未发现外部 API 调用,输入通常留在当前标签页内处理。
- 保存 / 分享
- 免账号使用
- 打开页面即可使用;刷新后是否保留结果取决于具体工具。
- 性能预算
- 首屏 JS ≤ 18 KB
- 没有声明 WASM 依赖,适合快速打开和移动端使用。
- 适用场景
- 生成器 · 程序员
- 分类和职业标签用于推荐相关工具、组织内链,并帮助用户快速判断是否适合当前任务。
怎么用
-
1. 输入
把内容粘贴或拖入工具面板。
-
2. 处理
点击按钮,在浏览器内本地处理,文件不上传。
-
3. 复制 / 下载
一键复制结果或下载到本地。
.htaccess 生成器 适合怎么用
适合快速生成初稿、起步素材或结构化结果,再人工整理后发布。
适合生成任务
- 从空白开始,先拿到一版可修改的结果。
- 生成可重复使用的草稿、名称、模板或占位素材。
- 先探索多个选项,再挑最适合当前任务的。
生成检查项
- 生成内容发给客户、上页面或进文档前,必须人工看过。
- 有品牌语气、格式或受众要求时,不要沿用默认值。
- 只保留真正符合任务的部分。
下一步可以接着做
这些入口会把当前任务接到更完整的工具链里。
常见问题
类似工具组合
做你这行的人, 还会一起用这些。