Server side publish looking for file path equivalent to local development server

I published my test app in production server (PHP/MySQL). However it failed to load data from the database.

Below is the screenshot of console:

As you can see there are multiple 404 not found errors.

When I checked the url, it is using the same base path as in local server. Why the base path didn’t get updated according to the production base path.

I checked the target for production, and it is configured properly with correct production path.

I recommend you to show a screenshot of your project settings

Also, on the production target, are you deploying to a root folder or a subfolder (e.g.: example.com/ vs example.com/folder1/)?

Below are screenshots:


I'm deploying to a subfolder.

Show the General tab on project settings, option “Links Relative To”:

Try changing your option

Here it is and thank you in advance for quickly looking into it:

Hi,

No problem! I’ve never deployed on a subfolder before, so I’m not the best person to continue assisting in this case - but the screenshots you’ve posted should now allow others to spot any possible problems.

Good luck!

P.S.: For a more “stress-free” deployment, consider deploying to a subdomain instead of a subfolder

Can anyone please help?

I’m stuck at this phase and couldn’t get the server deploy to work. Am I the only one who is experiencing this?

Is it a bug or I didn’t setup something right?

Can anyone please help?

@George @Teodor @patrick Can you please look into this.

Hi, can you show us more info?
In chrome dev tools - network (reload again), you can see in red, the bad calls, so point your mouse and check the url.
I barely remember having some troubles with the “auto add base” in some projects in subfolders.
For example: www.domain.com/index.php was redirected to www.domain.com/“projectname”/index.php

Show us your <script> and <link> tags, as a workaround you might need to manually modify those to match the right location

Here is the screenshot of the url:

The correct url should be:
http://domain.com/wpl/test/

But the base is being pointed at local base path:
http://domain.com/wappler/test/

Here’s the screenshot of the production code:

The base should be “/wpl/test/” but it is showing as “/wappler/test/”

I think the solution can be:

  1. In your general settings, turn off “auto add base” option
    Then, delete:
  2. The entire line 4 if you’re not using routing option
  3. Content"/wappler/test" in line 5
  4. The line 6
1 Like

THANK YOU!

This finally made it work. I deleted the lines 5 and 6 and when I saved the file, it automatically added the right base url.

Glad it helps, mark the reply as a solution, so others can see it.
And welcome to Wappler!

I tried to do that but I think that feature is enabled in the "how to" category only. It looks like I can't even change the topic/category after the post have been couple days old.

I got your topic moved to the right category, now you just need to mark the answer as solved. Thanks! :slight_smile:

1 Like

When I initially created that page, I hadn’t setup production target. That might be the reason it was using the development base url.

It seems the old pages before creating the production target persist the old base url and doesn’t update it. (That’s a good behaviour since, someone might want to change the base url manually)

It seems the new page created will automatically inherit the new base url.