CorefinityCorefinityDocs
Open the Control PanelControl Panel
Web server rules · 11 of 14

corestack_nginx_htaccess_convert

Convert .htaccess to nginx rules.

Scope readRuns as a taskNo secrets returned
On this page

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

Prompt
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

contentstringRequired

The .htaccess text, at most 256 KB. Up to 262,144 characters.

site_idintegerRequired

The environment row the rules are for (its platform and hooks). At least 1.

Example call

tools/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

ReasonWhat to do
too_largeThe file is over 256 KB; convert it in parts.
work_failedThe conversion expired before it was read; convert the file again.
invalid_argumentsThe 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_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe 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_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT