I’m trying to install Twill on a Laravel project hosted in a subdirectory, for example:
https://example.org/sub/
However, the CSS and JS assets from Twill are not loading properly. The application is trying to load them from the root domain like:
https://example.org/assets/twill/abc.js
But they should actually load from:
https://example.org/sub/assets/twill/abc.js
It seems that Twill is not respecting the subdirectory path when generating asset URLs.
What I’ve tried:
Updated .htaccess to handle the subdirectory path.
Attempted to configure Laravel’s APP_URL and asset() helper accordingly.
Checked Twill’s config files for any base URL setting.
My setup:
- Laravel is installed in a subdirectory (/sub)
- Apache2 on Ubuntu
- Twill installed via Composer
- I have tried adding /public to ASSET_URL still doesn’t works as the URL accessed by twill is different.
No issues with the main Laravel routing, just with Twill’s assets.
How can I make Twill correctly generate asset paths when Laravel is installed in a subdirectory?