Set domain redirect
set_domain_redirectConfigure a 301 redirect from a source domain to a destination URL by inserting or updating a marked .htaccess block. Includes automatic backup and optional path preservation.
Instructions
Insert or update a marked .htaccess 301 redirect block for a configured source domain. Creates a backup by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Relative .htaccess path under the source domain root. | .htaccess |
| backup | No | Back up existing .htaccess before writing. | |
| create | No | Create .htaccess if it does not exist. | |
| domain | Yes | Source domain to redirect, such as old-site.example.com. | |
| to_url | Yes | Destination URL, such as https://new-site.example.com. | |
| dry_run | No | Return resulting content without writing. | |
| server_id | No | Server profile id. Defaults to config.defaultServer. | |
| preserve_path | No | Append the original request path to the destination. |