I need to add a new Laravel app to an existing Wordpress website. Both will run via Apache webserver. The idea is that:
https://website.com/
-> Wordpress websitehttps://website.com/laravelapp
-> Laravel web application
In the filesystem, the root folder contains the Wordpress files and a subfolder laravelapp
contains the Laravel files (so, the laravel public
folder is a subfolder of laravelapp
).
When I browse these, this is the current returned result:
https://website.com/
-> returns the Wordpress website, with working permalinkshttps://website.com/laravelapp
-> returns 403 errorhttps://website.com/laravelapp/public
-> returns Laravel App
This shows me that mod_rewrite is available and working. But I want users to be able to just use the https://website.com/laravelapp
to access that laravel app (not the public folder).
I've been trying to setup the .htaccess
to make this arrangement possible, but am getting stuck. I currently have:
.htaccess
on root of website# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/laravelapp [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
.htaccess
onlaravelapp
folder<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /laravelapp/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ public/$1 [L] </IfModule> ```
.htaccess
onlaravelapp/public
folder contains the standard laravel .htaccess file from the distributed package.
Is there any way to make this possible?