---
title: "Convert .htaccess"
url: https://docs.corefinity.com/guides/sites/site-settings/convert-htaccess
type: guide
last_updated: 2026-11-13
feature: nginx-rules
related:
  - https://docs.corefinity.com/api/reference/site-settings/get-nginx-policy.md
  - https://docs.corefinity.com/api/reference/site-settings/get-site-nginx-rules.md
  - https://docs.corefinity.com/api/reference/site-settings/replace-site-nginx-rules.md
  - https://docs.corefinity.com/api/reference/site-settings/get-site-backup-guard.md
  - https://docs.corefinity.com/api/reference/site-settings/update-site-backup-guard.md
  - https://docs.corefinity.com/api/reference/site-settings/copy-site-nginx-rules.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_validate.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_history_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_revision_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_nginx_rules_revert.md
---
# Convert .htaccess

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

## 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**.

   _Screenshot: The Convert an .htaccess file dialog with an empty box labelled Paste the .htaccess, a note that up to 256 KB can be pasted or uploaded, and the buttons Cancel and Convert._

3. **Review the result**

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

   _Screenshot: The result of a conversion: one rule under Converted, Server hook; one line under Redirects found with the button Add 1 redirect; one line under Needs attention; and the groups Use another setting and Handled by the platform._

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](/guides/sites/site-settings/web-server-rules).

Nothing on the site changes until you save.

## What the groups mean

| Group                       | What to do                                                                                                                                                                     |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Converted**               | Rules ready for the editor. **Insert into editor** adds them.                                                                                                                  |
| **Suggested by AI**         | Rules to review before saving. **Insert the suggestions too** is ticked: untick it to leave them out.                                                                          |
| **Redirects found**         | Choose **Add redirects** (the button counts yours). [Redirects](/guides/sites/site-settings/redirects) opens **Import redirects** with these lines, ready to parse and import. |
| **Needs attention**         | Lines that could not be converted, each with the reason.                                                                                                                       |
| **Use another setting**     | Lines that another part of the Control Panel does, such as a PHP setting.                                                                                                      |
| **Handled by the platform** | Lines 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

**API:** [Create an .htaccess conversion](https://docs.corefinity.com/api/reference/site-settings/create-site-htaccess-conversion.md), scope `read`

```bash
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"
  }'
```

**MCP:** [`corestack_nginx_htaccess_convert`](https://docs.corefinity.com/mcp/tools/corestack_nginx_htaccess_convert.md), scope `read`

```json
{
  "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"
  }
}
```

**Control Panel:** Managed Websites › your site › Site settings › Web server rules ([https://manage.corefinity.com/go/nginx-rules](https://manage.corefinity.com/go/nginx-rules))

## Related

- [Web server rules](/guides/sites/site-settings/web-server-rules): Add your own nginx rules to a site.
- [Redirects](/guides/sites/site-settings/redirects): Send visitors from one path to another.
- [PHP configuration](/guides/sites/software-and-services/php-settings-and-php-ini): Change PHP limits, extensions and php.ini.
