# Edit an .htaccess File

To edit a .htaccess file, go to your publishing setup in RapidWeaver, and towards the bottom of the panel, you'll see a button named "Edit .htaccess File" — This will search for your .htaccess file on your web server and preset it in a window ready for editing.

From here you can make changes to your .htaccess file, along with adding a comment for the change you are about to make.

You can roll back to a previous .htaccess file by using the Versions" drop-down menu in the editor window.&#x20;

![The "Edit .htaccess" button can be found in your Publishing setup.](/files/PEJ5uM8op3QaFh6KfoB0)

### Redirect Examples

Here's an example of redirecting a page. The following code will redirect users trying to access the "/original-page/" to the "/new-page/".

```
Redirect 301 /original-page/ /new-page/
```

If we added the above code to the Realmac Software .htaccess file it would redirect users from this page: *<https://www.realmacvsoftware.com/original-page/>* to this page: \_<https://www.realmacvsoftware.com/new-page/_&#x20>;

#### Redirect with Match

The following example will redirect all subpage URLs from the "/helpdesk/" folder to /support.

```
RedirectMatch 301 ^/helpdesk(.*)$ /support
```

### What's a 301 redirect?

A 301 redirect is **a permanent redirect to the redirected page**. 301 refers to the HTTP status code for this type of redirect. In most instances, the 301 redirect is the best method for implementing redirects on a website.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.realmacsoftware.com/classic-manual/user-manual/how-to/edit-an-.htaccess-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
