Suppose I have a wordpress site running on the domain https://example.com
. I want to make it so that when the user visits https://example.com/nft
it displays a Laravel application.
I have currently updated the wordpress .htaccess as follows:
<code><IfModule mod_rewrite.c>
RewriteEngine On
# nft rules
RewriteCond %{REQUEST_URI} ^/nft
RewriteRule ^ nft/index.php [L]
# wp rules
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</code>
<code><IfModule mod_rewrite.c>
RewriteEngine On
# nft rules
RewriteCond %{REQUEST_URI} ^/nft
RewriteRule ^ nft/index.php [L]
# wp rules
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</code>
<IfModule mod_rewrite.c>
RewriteEngine On
# nft rules
RewriteCond %{REQUEST_URI} ^/nft
RewriteRule ^ nft/index.php [L]
# wp rules
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
and created a symlink using ln -s laravel-app/public/index.php website/nft/index.php
The problem is that when I visit the “nft” page I get “Forbidden”, but if I manually create the index.php file with an echo “test” I can display it correctly. What am I doing wrong?