# Change working directory

You need to change your working directory to **public** folder

There are two ways you can do this:

1. Using .htaccess file
2. By changing document root directory (Recommended)

### ***Using .htaccess***

Create a **.htaccess** file on the root directory( where **.env** is located)&#x20;

> Ignore if already available

<figure><img src="https://1659907811-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F03Ami4vp83Zu6IvVeZEu%2Fuploads%2FSaYGxuZ5M0xlHMoNPq71%2F.htaccess_create.jpg?alt=media&#x26;token=5cdd7560-c7fc-49c5-bcf7-91baea155fc2" alt=""><figcaption></figcaption></figure>

Edit **.htaccess** file and paste the below content

```apacheconf
<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
```

### By changing document root directory

1\. Login to **Cpanel**.\
2\. In the Domains section, click the **Addon Domains** or **Subdomains** icon, depending on which you'd like to modify.

<figure><img src="https://content.hostgator.com/img/cpanelv2-domains-addon-subdomains.png" alt=""><figcaption></figcaption></figure>

3\. Locate the **addon domain** (or **subdomain**) you wish to modify.

4\. Click the **pencil icon** next to the current document root for the domain you wish to modify.

<figure><img src="https://content.hostgator.com/img/cpanelv2-domains-modify-addon-domain.png" alt=""><figcaption></figcaption></figure>

\
5\. In the pop-up window, enter the new document root(from ***example.com** to **example.com/public***) and click **Change**

<figure><img src="https://content.hostgator.com/img/cpanelv2-change-document-root.png" alt=""><figcaption></figcaption></figure>


---

# 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://picotech.gitbook.io/pico-mail/installation/installation-on-hosting-server/change-working-directory.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.
