Reputation: 11
I am using laragon server for php 7.2 laravel. I have tried a lot to remove public keyword from my url http://localhost/myLaravel/public/ by its normal method of copying .htaccess folder in my laravel project directory as well as by copying and renaming server file to index.php. But it didn't work. whenever i write this url: http://localhost/myLaravel/ it give me following error: Forbidden You don't have permission to access /myLaravel/ on this server.
Any solution?
Upvotes: 0
Views: 1350
Reputation: 88
You can use this htaccess code in laravel root directory.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Upvotes: 0
Reputation: 22673
Laravel app is not meant to be accessible in a subdirectory by default. You can do one of the following:
myLaravel/public
directory, if you want a dedicated domain or subdomainpublic
directory to the root of your Laravel app, as described here: How to make public folder as root in Laravel?Upvotes: 1