Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with applications in subdirectories #246

Closed
kai0310 opened this issue Apr 24, 2022 · 13 comments
Closed

Problems with applications in subdirectories #246

kai0310 opened this issue Apr 24, 2022 · 13 comments

Comments

@kai0310
Copy link

kai0310 commented Apr 24, 2022

Describe the bug
This occurs when the application is placed in a subdirectory.

The APP_URL and ASSET_URL also include subdirectories, but this does not work.Some sexuals, such as modals, will work, but may not work with respect to those that publish URLs at the same time they work.

For example, in the example using dialog, the following URL is issued without subdirectories.

Application URL: https://example.com/app/
Output URL: https://example.com/wireui/button?method=deletePost&params=Saved&......
Expect URL: https://example.com/app/wireui/button?method=deletePost&params=Saved&......

@PH7-Jack
Copy link
Member

Why the expected URL must include the subdirectories?
The resource is the same for all tenant

@PH7-Jack
Copy link
Member

Could you explain more your issue?

@kai0310
Copy link
Author

kai0310 commented May 21, 2022

@PH7-Jack
Thanks for the reply!

This is because the application is located in a subdirectory. Therefore, if a subdirectory is not in the URL, a 404 error is returned.
Since wireui is set up in the application, of course the URL must be issued with the subdirectory in which the application is located.

There is a way to use a subdomain, but I would like to know what the solution would be if I were to install in a subdirectory.

Please let me know if I'm not explaining it well enough.

@PH7-Jack
Copy link
Member

I'm sorry, but I didn't understand completely
You have an application running in a subdirectory

/root/web/app/app-1
/root/web/app/app-2

You have a DNS record point to your server
Your Nginx or Apache is serving your domain example.com with the /root/web/app/ directory
And the app-1 and app-2 is accessible in the same URL

example.com/app-1/home
example.com/app-2/home

Is that? If so, it's not the better way to server multiples apps in the same URL, you can use the wildcard subdomains

app-1.example.com
app-2.example.com

Otherwise, the wireui will use the laravel route provider to server the wireui route, I can't change the route provider, but you can create your own API to this, just register this controller in your web route with a path that you want. Add a script tag in the HTML to fetch the assets in the new route.
Another thing that you need to do is create a custom directive to the wireui hooks scripts https://github.com/wireui/wireui/blob/main/src/Support/BladeDirectives.php#L20

@PH7-Jack
Copy link
Member

PH7-Jack commented Jul 3, 2022

Old issue, closing it now. Tag me to re-open if your problem still persists

@PH7-Jack PH7-Jack closed this as completed Jul 3, 2022
@undjike
Copy link

undjike commented Oct 10, 2022

@PH7-Jack I don't know if it's the right place for that but it seems to go the same way.

I have issue with icons when serving application in a subdirectory. I mean the app is not at the root url.
Ex: http://localhost/appname.

I have updated the .env file accordingly.

APP_URL=http://localhost/appname

Note: Notifications work (without the icon showing) and I have a icon related error in the console (404 Not Found). And I'm seeing that the path is not good (http://localhost/wireui/icons/outline/check-circle instead of http://localhost/appname/wireui/icons/outline/check-circle).

This strange message displays behind the notification:

This page contains the following errors:
error on line 1 at column 50: Space required after the Public Identifier
Below is a rendering of the page up to the first error.

@undjike
Copy link

undjike commented Oct 10, 2022

@PH7-Jack any solution?

@undjike
Copy link

undjike commented Oct 10, 2022

I've cleared cache, config and view no change.

image

@kai0310
Copy link
Author

kai0310 commented Oct 10, 2022

@undjike

It seems that it is not intended to put the application directly in a subdirectory.

As mentioned here, for example, edit the hosts and apply the application's subdomain.

@undjike
Copy link

undjike commented Oct 10, 2022

Alright, thanks @kai0310 .

@safwanAzman
Copy link

any solution ?

@swartjie
Copy link

swartjie commented Aug 1, 2023

I am having the same problem. Is it not possible to have the WireUI url for resources, either use the APP_URL from the .env file or use a variable in it's config?
In my case I have a project on localhost in a sub folder, but the files being loaded go right to http://localhost:8080/wireui/icons/outline/check-circle for example, instead of the project folder which is http://localhost:8080/myproject/wireui/icons/outline/check-circle

@LaMance22
Copy link

I have the same problem as @swartjie
error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants