'Website loads as example.com but also as example.com/folder/public/index.php
I'm using GoDaddy's shared hosting and my document root is home/user/public_html. I cloned my Laravel code from Github and it created a folder. Now, the public index.php file is inside home/user/public_html/folder/public/index.php.
I've created a soft symbolic link for index.php inside public_html and also added the htaccess in it (there is no htaccess inside /home/user/public_html/folder/public). The website is loading fine as www.example.com and/or www.example.com/about; but it's also loading as example.com/folder/public/index.php and/or example.com/folder/public/index.php/about
What should I change in the htaccess so that users that are visiting the site as www.example.com/folder/public/index.php get automatically redirected to www.example.com
Here is my current htaccess located in /home/user/public_html
<IfModule mod_rewrite.c>
RewriteCond !{HTTPS} on [OR]
RewriteCond %{HTTP_HOST} !^www\.tradifyservices\.com$
RewriteRule ^ https://www.tradifyservices.com%{REQUEST_URI} [R=301,L]
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
