# White screen on shared hosting & urls duplicating

**URL:** https://discourse.roots.io/t/white-screen-on-shared-hosting-urls-duplicating/11086
**Category:** bedrock
**Created:** 2017-12-07T20:32:56Z
**Posts:** 5

## Post 1 by @reagan — 2017-12-07T20:32:56Z

Hello, I’m on a shared web hosting environment unfortunately with none of the normal means of deploying a bedrock site. I do however have ssh and sftp access and am able to access above the web root (public\_html) to place the files where things need to be.

A little background on the server: There are a few word press installs in both the root and various subdomains. I have created a subfolder for my Bedrock install and uploaded the files.

the folder structure looks something like this:

```
~/
├── bedrock # Config folder with .env and the rest of the files that are not within the web folder. This is outside of the public_html folder and only accessible by the server.
└── public_html # public_html is the web folder that contains the fore mentioned regular word press site.
  └─ subdomain # subdomain folder. Contains the contents of the web folder.
```

Above the web root in my bedrock folder I have uploaded the **.env** file & **config** and **vendor** folders:

```
bedrock
├── .env
├── wp-cli.yml
├── config
└── vendor
```

In my . **env** file:

```
WP_HOME=http://subdomain.mydomain.com
WP_SITEURL=${WP_HOME}/wp
```

In my **config/application.php** :

```
$webroot_dir = $root_dir . '/public_html/subdomainfolder';
```

and finally

**wp-cli.yml**

```
path: /wp
```

also my **composer.json** file.

```
"extra": {

 "installer-paths": {

 "~/public_html/isparx/subdomain/mu-plugins/{$name}/": ["type:wordpress-muplugin"],

 "~/public_html/subdomain/app/plugins/{$name}/": ["type:wordpress-plugin"],

 "~/public_html/subdomain/app/themes/{$name}/": ["type:wordpress-theme"]

 },

 "wordpress-install-dir": "~/public_html/subdomain/wp"

 },
```

Now in my subdomain folder aka the folder that holds the contents of what is normally the web folder I have edited

In my **wp-config.php** :

```
$bedrock = realpath(dirname( __DIR__ ) . '/../bedrock');
require_once($bedrock . '/vendor/autoload.php');
require_once($bedrock . '/config/application.php');
```

The site loading the index and it is loading the .env file/database etc…

However the page loaded is blank white ~~and throws a notice of **hosts is undefined on line /wp/ /wp/wp-includes/canonical.php 461**~~

~~My understanding would be that an improper wp\_home reference or link would cause this. I believed I put in all the correct patches, at this point I am a little lost on what else needs to be reconfigured to get the site up in working order?~~

Edit: Fixed the issue notice issue by running composer update, however white screen issue persists. No thrown errors. Tried disabling both plugins and themes. Still no luck. I also tried nuking the database and starting from scratch just to see if the migration of the database was the issue but the issue persists.

Edit: I can get other urls than index to resolve, such as [sub.domain.com/wp/wp-login](http://sub.domain.com/wp/wp-login) however the result is [https://sub.domain.com/sub.domain.com/wp/wp-login.php](https://sub.domain.com/sub.domain.com/wp/wp-login.php) something is gravely wrong.

Any ideas and suggestions are more than welcome.

---

## Post 2 by @ben — 2017-12-08T06:38:12Z

Does this help?

> [@Bedrock subfolder install on shared hosting](https://discourse.roots.io/t/bedrock-subfolder-install-on-shared-hosting/5508):
>
> Hi there, Following up on this [issue on Github](https://github.com/roots/bedrock/issues/180), I’m trying to achieve @Foxaii’s following solution: ├── bedrock # Config folder with .env above the web root and is only accessible on the server. ├── subdomain\_bedrock # Subdomain config folder └── public\_html # public\_html becomes your web folder and is moved outside the bedrock config. └─ subdomain # subdomain becomes your web folder for the subdomain\_bedrock config. I’m on a shared webhosting environment with access …

---

## Post 4 by @reagan — 2017-12-08T14:24:42Z

This post was actually what I used as a model for setting up as well as @Foxaii posts in the original thread as well.

---

## Post 5 by @Foxaii — 2017-12-13T10:25:15Z

I know you’ve said no errors thrown, but it’s worth checking the actual error log as these wouldn’t show in the browser on a production environment.

From what you’ve described your bedrock and public\_html directories are at the same-level, but your `$webroot_dir` declaration suggests bedrock is the parent directory. You’ll need to make sure the paths resolve correctly.

You can also change the path depending on the environment so it’ll still work on a default Trellis development environment:

```
if (WP_ENV === 'production') {
  $webroot_dir = dirname(dirname( __DIR__ )) . '/public_html/subdomainfolder';
} else {
  $webroot_dir = $root_dir . '/web';
}
```
