corestack_ nginx_ htaccess_ convert
Convert .htaccess to nginx rules.
When to use it
Convert an Apache .htaccess file into nginx rules for an environment row. The table-driven part is converted at once; lines it cannot convert are sent, redacted, to an AI model for suggestions to review. Nothing is saved: put the result through corestack_nginx_rules_validate and corestack_nginx_rules_update, and the redirect lines through corestack_redirects_import. 20 conversions an hour per person.
The task completes with conversion: the rules per hook with their source lines, the Apache redirect lines, the lines the platform already handles, pointers to other settings, the unconverted lines, and ai.status (not_needed, running, done, failed or disabled). An AI failure still completes with the deterministic part. Follow the task with corestack_task_get.
Ask for it
Using the Corefinity MCP server, call corestack_nginx_htaccess_convert with site_id 4211, content Redirect 301 /old /new
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
. (Convert .htaccess to nginx rules.) Tell me what it returned.Inputs
The .htaccess text, at most 256 KB. Up to 262,144 characters.
The environment row the rules are for (its platform and hooks). At least 1.
Example call
{
"name": "corestack_nginx_htaccess_convert",
"arguments": {
"site_id": 4211,
"content": "Redirect 301 /old /new\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule ^ index.php [L]\n"
}
}If it is refused
| Reason | What to do |
|---|---|
too_large | The file is over 256 KB; convert it in parts. |
work_failed | The conversion expired before it was read; convert the file again. |
invalid_arguments | The arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again. |
tenant_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it. |
rate_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |