Http error 404 when ip is in a subfolder

facing an error as

Uncaught Dotenv\Exception\InvalidFileException: Failed to parse dotenv file. Encountered an invalid name at [<?php exit('No direct script access allowed'); ?>]. in /home/domain/sub-domain/invoice/ip/vendor/vlucas/phpdotenv/src/Parser/Parser.php:30
Stack trace:

  throw new InvalidFileException(\sprintf('Failed to parse dotenv file. %s', $error));

Open up your ipconfig.php file and place a ‘#’ in front of the <?php (whatever it ways there)

currently we are receiving an error,

404 Page Not Found

The page you requested was not found.

the IP_URL= sub-domain.domain/ip

sub-directory added

RewriteEngine On
RewriteBase /ip
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subfolder/index.php [L]
RewriteRule . /index.php [L]

php – BEGIN cPanel-generated handler, do not edit

Set the “ea-php81” package as the default “PHP” programming language.

AddHandler application/x-httpd-ea-php81 .php .php8 .phtml # php -- END cPanel-generated handler, do not edit all the installation guidelines followed, still the application is not loading

kindly support

Well… your 404 error, is it the default apache error or is it a big error generated by ip?

it don’t seems a apache error, the .htaccess files are aligned as same to the to installation document,

InvoicePlane htaccess

RewriteEngine On RewriteBase /ip RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteRule . /subfolder/index.php [L]

php – BEGIN cPanel-generated handler, do not edit

Set the “ea-php81” package as the default “PHP” programming language.

AddHandler application/x-httpd-ea-php81 .php .php8 .phtml # php -- END cPanel-generated handler, do not edit

it seems to be a big error generated by ip.

Just show a screenshot, but remove your own url from that screenshot

1 Like

We can’t really support editing your .htaccess file, but here it goes…

This:
RewriteRule . /subfolder/index.php [L]

Has to be something else.

Also:

  1. Open your ipconfig.php
  2. find REMOVE_INDEXPHP and what does it say after that
  3. copy/paste that here

REMOVE_INDEXPHP=true

I will not have time to reproduce your problem until this weekend.

In the meantime you can solve this:

This:
RewriteRule . /subfolder/index.php [L]

Has to be something else.

It might also help wth your 404 problem