# :linked_files('.env') is hidden directory instead of actual file, leading to 404

**URL:** https://discourse.roots.io/t/linked-files-env-is-hidden-directory-instead-of-actual-file-leading-to-404/18959
**Category:** bedrock
**Tags:** deploys
**Created:** 2020-08-25T17:37:39Z
**Posts:** 3

## Post 1 by @shed-00 — 2020-08-25T17:37:39Z

I am having a weird issue with deploying bedrock using Capistrano, and so I want to outline the issue first, and then hopefully, I will comment the solution later on.

I am using [roots/bedrock-capistrano](https://github.com/roots/bedrock-capistrano) to deploy a [roots/bedrock](https://github.com/roots/bedrock#installation) project on a shared web host, Hostinger. There are 0 tables in the database at the moment, meaning WordPress needs to be installed.

Background

- The deployment successfully completed without errors. All the necessary folders are present on the server.
- I used SFTP to upload the filled-out `.env` file to my `shared` folder.
- The `public_html` symlink is pointing correctly to the `current/web` release thanks to a [custom deployment task](https://github.com/roots/bedrock/issues/76#issuecomment-44567038).
- I am using this line exactly as provided by roots:

```
set :linked_files, fetch(:linked_files, []).push('.env')
```

**However, there is an issue:** My domain redirects to 404 at all levels, even at [http://example.com/wp/wp-admin](http://example.com/wp/wp-admin)

My first instinct was that the database credentials were wrong; however, I was able to remotely connect to my database using MySQL Workbench without issue. The database credentials are not the issue.

I listed out the file contents of the `/current/` directory using SSH, and noticed that `.env` was missing. To double-check, I opened my SFTP client, and noticed that `.env` _ **is** _ present; however, it is a hidden directory instead of a file. Hopefully these images show the issue:

SFTP shows .env as folder:  
 ![env_as_directory_instead_of_file](https://discourse.roots.io/uploads/default/original/2X/0/08c22cba24fe49ead924f6a3278017e1036de5b7.gif)

SSH missing .env:

 ![env_treated_as_hidden_directory](https://discourse.roots.io/uploads/default/original/2X/5/525095cbae6e23c641fa2247919a28587944f75f.gif)

---

## Post 3 by @shed-00 — 2020-08-27T01:11:52Z

To resolve this, I changed `deploy.rb` to symlink `/current/web` folder and the domain’s **correct DocumentRoot** : `/home/username/domains/domain.com/public_html`

( **not** `/home/username/public_html` because I have more than one domain)

The FTP client sleuthing was irrelevant and wrong; the `.env` file is present, as can be seen in the SSH client with `ls -a`.

**Made the add-on into a gist.**  
Please provide constructive feedback if you have any. I hope to improve.

> <https://gist.github.com/shed-00/775e4293d90237b695e34307b50cd9e7>
