How to remove the local server project folder from links on the live server?

My project is PHP on XAMPP

How to remove the development local server project folder (my-project) from links on the live server?

127.0.0.1/my-project/admin/login.php

to be: https://mysite.com/admin/login.php

Even if I set a remote folder to website root, not public/my-project

it remembers my-project in links.

  1. How to set it correctly in Wappler,

and

  1. How and where to set it without Wappler, in files, if I want to install an app manually on some remote server?

Hi,

You can try setting links “relative to document” option in project settings, and see if that helps.

Last I remember working on PHP and this issue, this is what I did:
After you have added the remote target with correct settings, you will have to go into each page and save it again. Wappler will automatically change the paths.

If the first option does not work out for you, you can just set the same folder structure on the remote server too as your local, or try vice-versa. That way path always remain same.
This is not at all ideal. But this is not really a Wappler issue. Its just how servers and web work.

Thank you, Sid, for answering.

I`ve discovered tricks with saving every page again as you are suggesting, but the links are unpredictable. Tried with the same structure as a local server, but no POST or GET functions are working. So I tought it may be that root folder is better option. That with functionalities is second part of the problem. Just first wanted to to resolve this with links.

Havent seen this on my end. But could be that those links are not updated as per folder structure.

A bit of a pain to discover this in the middle of a release, but you will just have to fix it all for easier deployments in the future.

Exactly. I must find the way, becouse everything was functional on local server and it makes no sense that I cant use it in a production. Btw, I am on the version 3.9.9.

That is why we discourage to place your website in a subfolder because when you want to move into tge root you have to rewrite the paths of most of your pages and their includes.

We do have some path fixing on save, but you still have to open each pages, save it and still check your paths.

My experience has been that it is the paths of the server action urls that usually fail during a save.
Take a look at the urls in the head, and compare the server action urls with them, i.e., “…/” to “…/…/” etc.

Hi, George,

I shuold use an empty htdocs folder on XAMPP, but it was no case, and Wappler did`t want to use htdocs as project folder, so I went with subfolder.
I think that links are not the only problem to solve. There is no connection to dmxAppConnect or something.

Yes, but in that way, I am losing local editing, and for local server need to repair links again.

With a new, clean project made in the root folder, I have the same problem considering saving the data to DB on the remote server. Here is the link:
https://wap.webixdesign.com/register.php
Is it possible to discover the problem?

image

This is what I see in browser’s dev tools’ Network tab. Error is in the DB connection. Not related to the current topic.

Thank you. Why there is accessing to DB with local credentials on uploaded project with remote DB credentials? Any link to related topic?

Well you need to define your database connection per target:

Hello, Teodor,
Thank you for answering.
Absolutely, connections were defined properly.

Finally, I`ve solved all problems by eliminating the use of the localhost database.
Both targets are connected to the same remote database.
All functions are back now. Problem with local and remote DB initiated my messing with folders.
Anyhow, my advice is to work with the local target pointed to the root of htdocs or www folder on HAMPP or WAMPP respectively.

1 Like