0

So I have a LEMP stack set up on a staging server and on my local. I have it set up as a Multi-Store. The staging server and local are identical. Except that the local is running off of Laravel Valet and the Staging server is just a regular LEMP stack.

I have the Multi-Store setup, on my local it works perfectly. For the secondary domain it shows me exactly what I should expect to see. But on the Staging server I can verify it's loading the secondary site, but I get a 404 error.

The only difference that I can find is that on my local Laravel Valet is running off of /index.php and that is where I had to set the variables to load the secondary site. But on the Staging server I'm running a specific Magento config and it's loading based on /pub/index.php And this is the site that comes up with a 404 error on the secondary domain.

I can't figure this one out. The index.php files are similar but there are a few differences. All I can assume is that slight difference in document root is causing the issue. The ideal configuration I'm sure is that the document root be set to the /pub/ directory, but this is the method that I can't seem to get working. Any help is much appreciated.

UPDATE: I tried to set the staging server to just use / instead of /pub like my local is using. Unfortunately I still got a 404 on the secondary domain, and then on the primary all the assets were missing because of an incorrect path on those elements now.

UPDATE: I didn't have a home page created but it stilled showed on local. I created one anyway, still doesn't work. Oddly enough all other URL's work. Try to go to a category page, it works. Try to go to the login page, it works. The only thing that I think doesn't work is the home page that I've found so far.

2 Answers 2

0

Don't have enough for comments.

Check the .htaccess file and clear the cache and reindex everything.

3
  • This is using Nginx so no .htaccess file. I've cleared the cache, reindexed everything, rebuilt all the static directories, everything I can imagine. Again this works fine on local. And the primary domain works fine, but the secondary domain throws a 404 error, doesn't make any sense. Commented Nov 14, 2017 at 23:18
  • Check the nginx requests (access.log and error.log) see where exactly it goes the request. Check the DB core_config_data file and make sure you're base url has a slash at the end.
    – obsergiu
    Commented Nov 15, 2017 at 1:35
  • There is a slash at the end of the base URL. I looked at the log file and it just says "GET / HTTP/2.0" 404. It seems to me like it's not loading the index.php at all when it's default. However, for all sub pages it does, and for the primary store in this multi-store setup it does and they both are sharing the same config as just aliases. It's a head scratcher. Commented Nov 15, 2017 at 2:16
0

So I finally figured the problem.

I never set the default Home Page under:

Stores >> Settings >> Configuration >> General >> Web >> Default Pages

Now granted it was automatically picking up the default but the default was ear marked as only available for the other website not for all stores. And I did create a new page ear marked for the second website, but I didn't know that it also had to be set here as the default page. Silly mistakes, but I hope someone can learn from me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.