← 返回 Skills 市场
johnnywang2001

htaccess Generator

作者 John Wang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
204
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install htaccess-gen
功能描述
Generate .htaccess files for Apache web servers. Use when creating redirect rules, URL rewrites, security headers, HTTPS enforcement, IP blocking, caching ru...
使用说明 (SKILL.md)

htaccess-gen

Generate production-ready .htaccess configurations from the command line.

Quick Start

# Generate HTTPS redirect + security headers + caching
python3 scripts/htaccess_gen.py generate --https --security-headers --caching

# Generate redirect rules
python3 scripts/htaccess_gen.py redirect --from /old-page --to /new-page --type 301

# Block IPs
python3 scripts/htaccess_gen.py generate --block-ip 192.168.1.100 --block-ip 10.0.0.0/24

# Full production config
python3 scripts/htaccess_gen.py generate --https --www --security-headers --caching --gzip --error-pages --hotlink-protection --output .htaccess

Commands

generate

Create a complete .htaccess file with selected features.

Options:

  • --https — Force HTTPS redirect
  • --www — Force www prefix (or --no-www to remove it)
  • --security-headers — Add security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, HSTS)
  • --caching — Add browser caching rules (mod_expires)
  • --gzip — Enable gzip/deflate compression
  • --error-pages — Add custom error page directives (403, 404, 500)
  • --hotlink-protection — Prevent image hotlinking
  • --domain \x3Cdomain> — Your domain name (used for hotlink protection and www rules)
  • --block-ip \x3Cip> — Block an IP address or CIDR range (repeatable)
  • --cors — Enable CORS headers
  • --cors-origin \x3Corigin> — Specific allowed origin (default: *)
  • --index \x3Cfile> — Set directory index file
  • --output \x3Cfile> — Write to file instead of stdout

redirect

Generate redirect rules.

Options:

  • --from \x3Cpath> — Source path (required)
  • --to \x3Cpath> — Destination path or URL (required)
  • --type \x3Ccode> — HTTP status code: 301 (permanent) or 302 (temporary). Default: 301.

rewrite

Generate URL rewrite rules.

Options:

  • --pattern \x3Cregex> — Regex pattern to match (required)
  • --target \x3Cpath> — Rewrite target (required)
  • --flags \x3Cflags> — RewriteRule flags (default: [L,QSA])
  • --condition \x3Ccond> — RewriteCond to prepend (repeatable)

Feature Details

Security Headers

Adds these headers via mod_headers:

  • X-Frame-Options: SAMEORIGIN — Prevents clickjacking
  • X-Content-Type-Options: nosniff — Prevents MIME sniffing
  • X-XSS-Protection: 1; mode=block — XSS filter
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: camera=(), microphone=(), geolocation=()
  • Strict-Transport-Security: max-age=31536000; includeSubDomains (when --https)

Caching Rules

Sets expiry times via mod_expires:

  • Images: 1 month
  • CSS/JS: 1 week
  • HTML: 1 hour
  • Fonts: 1 year
安全使用建议
This skill appears coherent and limited to generating .htaccess content. Before using: (1) review the generated .htaccess before deploying to production, (2) run the script without elevated privileges and avoid output paths that could overwrite system files, (3) supply your real domain to avoid example.com defaults, and (4) be aware of configuration side-effects (e.g., CORS '*' or HSTS includeSubDomains) which have operational/security implications for your site. If you need stricter assurance, inspect the script locally or run it in an isolated environment first.
功能分析
Type: OpenClaw Skill Name: htaccess-gen Version: 1.0.0 The skill is a straightforward utility for generating Apache .htaccess configuration files. The Python script (scripts/htaccess_gen.py) uses standard libraries to construct configuration strings for redirects, security headers, and caching based on command-line arguments, with no evidence of malicious intent, data exfiltration, or suspicious execution patterns.
能力评估
Purpose & Capability
Name/description (htaccess generation, redirects, rewrites, headers, caching, IP blocks, etc.) align with the included script and declared requirements (no credentials, no external binaries). All requested functionality is provided by the script.
Instruction Scope
SKILL.md instructs running the included Python script with options that map directly to the features. The script prints to stdout or writes to an --output path; this is expected. Note: when used with --output it will write/overwrite the provided path on the filesystem, so review/choose output paths carefully (avoid running as a privileged user or pointing output to sensitive system files).
Install Mechanism
No install spec; this is an instruction-only skill with an included Python script. No downloads, package installs, or external installers are present.
Credentials
The skill declares no environment variables, credentials, or config paths and the code does not read environment variables or secrets. The requested permissions are minimal and proportionate.
Persistence & Privilege
always is false and the skill does not modify other skills or global agent configuration. It can write files when given an --output path (expected behavior for a generator), but it does not persist settings or request elevated/system privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install htaccess-gen
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /htaccess-gen 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of htaccess-gen. - Generate production-ready .htaccess files from the command line - Supports HTTPS enforcement, www/non-www redirects, security headers, browser caching, gzip compression, custom error pages, hotlink protection, CORS, IP blocking, directory indexes, redirects, and rewrites - Includes options for feature selection and file output - Useful for converting nginx rules to Apache .htaccess format
元数据
Slug htaccess-gen
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

htaccess Generator 是什么?

Generate .htaccess files for Apache web servers. Use when creating redirect rules, URL rewrites, security headers, HTTPS enforcement, IP blocking, caching ru... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 204 次。

如何安装 htaccess Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install htaccess-gen」即可一键安装,无需额外配置。

htaccess Generator 是免费的吗?

是的,htaccess Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

htaccess Generator 支持哪些平台?

htaccess Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 htaccess Generator?

由 John Wang(@johnnywang2001)开发并维护,当前版本 v1.0.0。

💬 留言讨论