How to deploy Laravel 5.8 project inside another PHP project?

345 Views Asked by At

I need to set up my Larave project inside another PHP project to access that project using https://example.com/laravel-project

Because I need to use the same domain for the new Laravel project.

For that, I used apache VirtualHost configuration like below,

<VirtualHost *:80>
    ServerName example.com
    DocumentRoot "C:/Wamp/vhosts/example"

    Alias /laravel-project "C:/Wamp/vhosts/example/blog/laravel-project/public"

    <Directory "C:/Wamp/vhosts/example">        
        allow from all
        order allow,deny
        AllowOverride All
    </Directory>
</VirtualHost>

Now routes are working fine but query strings not working well. seems every url missing query strings.

https://example.com/laravel-project?test=value

But Laravel App didn't identify test query parameter.

How can I fix this problem?

1

There are 1 best solutions below

0
Gayan On

The issue was not in VirtualHost configuration, It's in .htaccess file configurations. Updating RewriteRule with [QSA] flag, solved query string missing issue.

RewriteRule ^ index.php?$1 [L, QSA]