Using Invoiceninja in a subfolder on shared hoster

I read the instructions on the provided link more carefully.

now you can use function subdirAsset instead of asset and subdirMix instead of mix inside your blade files.

Right, so I’d either have to change all blade files or the laravel core. Both would render the app nonupdateable.

So maybe the devs of the project would implement this. It’ll be great. I am not deep enough into laravel to help yet, but maybe I’ll find some time to learn laravel on a deeper level.

Next update:

I opened the project in VS Code and replaced the functions within the blade files. and reran php artisan optimize and composer install again.

It seems to work.

I’d like to fork it and make a pull request. It has to be tested more thoroughly…

I’ll keep you updated.

I am able to run v5 behind Apache under a subfolder, the mobile app works too. I do not think I did anything fancy anywhere else.

(.env)

APP_URL="https:/domain.com/invoiceninja/public"

And I access the page with https:/domain.com/invoiceninja/public/index.php

1 Like

Hi XRay,
yes, I could access the thing with your provideded URL structure the whole time.

My issue was that I wanted the public/index.php gone from my URL. Some internal links within invoiceninja didn’t work with it.

Please test whether you can access the .env-file from the browser with this kind of URL:

https://yourdomain.com/invoiceninja/.env

No I cant because it is forbidden, it should not be accessible anyway.

Exactly, it shouldn’t.
Then no concerns here.

it doesn’t work for me. maybe my apache2 sever block is the issue. if you don’t mind to share what yours look like please. I really don’t wanna sacrifices a domain for invoice ninja. accessing with mydomain .com/ninja is my goal

i have ninja in an isolated folder /test/ninja then i symbolic link it to var/www/html folder. i get a white page with the invoice ninja background image

Hi XRay,

I hope you’re still active on this forum. I have scoured the internet for a solution, and you stated you got it working despite others saying it isn’t possible.

I managed to get InvoiceNinja running in a subfolder by manually adding /public/index.php to the URL (the setup process resulted in several 404s, but in the end it did work).

The problem, however, is that some things don’t work, for example “Download PDF” on an invoice, the PDF preview when you click “Send email” and other things. The reason for this is that, for some reason, it tries to request stuff from the subdirectory/client/ in stead of subdirectory/public/client/

And this problem occurs for other subfolders of the /public/ folder as well. For example, the link/button that customers receive in the automatic email to view the invoice also doesn’t work, because it’s missing the public folder in the URL as well.

Did you manage to get this fixed in your case?

Thanks!

Laurens