I researched about this problem and found many solutions, but could not find a solution to the problem which arise after editing .htaccess file. Here is my problem. I followed this solution for removing 'public' from URL of my laravel website and it works fine. However, when I open my website with 'public' at the end of base URL, it also opens up the same page. As far as I know, it's a bad thing from the SEO's point of view. I want my site to be opened only with the base URL and not with 'public' at the end of the base URL. My website is on shared hosting. How can I achieve that?
This is how my .htaccess file looks right now -
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php