CorefinityCorefinityDocs
Open the Control PanelControl Panel
Site settings · 5 of 8

Convert .htaccess

Turn the .htaccess file from an Apache host into web server rules and redirects for a site.

On this page

Before you start

  • You can open the site in Managed Websites. Anyone who can open a site can convert a file and save the result.
  • You have the .htaccess file from your old host, up to 256 KB. Convert a larger file in parts.

Convert the file

  1. Open the converter

    Go to Managed Websites, choose the site, then Web server rules under Site settings. Choose Convert an .htaccess…, or on a site that already has rules, open the section's … menu and choose Convert .htaccess….

  2. Paste the file

    Paste the file into Paste the .htaccess, or upload it, then choose Convert.

  3. Review the result

    The summary line counts what was found. Open each group to read it.

  4. Put the rules in the editor and save

    Choose Insert into editor. The rules are added unsaved: check them, then test and save them as in Web server rules.

Nothing on the site changes until you save.

What the groups mean

GroupWhat to do
ConvertedRules ready for the editor. Insert into editor adds them.
Suggested by AIRules to review before saving. Insert the suggestions too is ticked: untick it to leave them out.
Redirects foundChoose Add redirects (the button counts yours). Redirects opens Import redirects with these lines, ready to parse and import.
Needs attentionLines that could not be converted, each with the reason.
Use another settingLines that another part of the Control Panel does, such as a PHP setting.
Handled by the platformLines the site does not need. Nothing to do.

Each user can run 20 conversions an hour, and a result is kept for an hour. The values of SetEnv lines are never shown or stored.

Automate this

Convert .htaccess

Converts an Apache .htaccess file into Nginx rules per hook, the redirect lines for the site's redirects, and the lines that could not be converted; nothing is saved.

POST/api/corestack/sites/{site}/nginx-rules/htaccess
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules/htaccess \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "RewriteEngine On\nRedirect 301 /old-page /new-page\nOptions -Indexes\nHeader set X-Frame-Options SAMEORIGIN\n"
  }'
Was this helpful?
Open in ClaudeOpen in ChatGPT