Deploy Laravel Inertia to OpenLiteSpeed

60 views Asked by At

I already setup virtual host at my openlitespeed panel with setting up my document root in $VH_ROOT/public_html. And i copy my public in laravel application to public_html/app-name with .htaccess setup like this

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On
    RewriteBase /app-name

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

But when i open my application using url => http://<MY IP>/app-name it will automatically change to http://<MY IP>/app-name/app-name and when i refresh page it will return not found. even when i redirecting, the redirect will go to http://<MY IP>/some-redirect not http://<MY IP>/app-name/some-redirect.

I already tried to add prefix in web.php but the url become http://<MY IP>/app-name/app-name/app-name and the redirect must be http://<MY IP>/app-name/app-name

Please help me for find this error and fixing it

0

There are 0 answers