Add Trailing Slash .htaccess
RewriteCond %{REQUEST_URI} !(/$|\.) RewriteRule (.*) %{REQUEST_URI}/ [R=301,L] This code needs to be put at the top of your .htaccess file below RewriteEngine On
RewriteCond %{REQUEST_URI} !(/$|\.) RewriteRule (.*) %{REQUEST_URI}/ [R=301,L] This code needs to be put at the top of your .htaccess file below RewriteEngine On
Change your code to this: Options -MultiViews RewriteEngine On RewriteBase /Testlaravel/public/ # Redirect Trailing Slashes… RewriteRule ^(.*)/$ $1 [L,R=301] # Handle Front Controller… RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L]
It is not a question of preference. /base and /base/ have different semantics. In many cases, the difference is unimportant. But it is important when there are relative URLs. child relative to /base/ is /base/child. child relative to /base is (perhaps surprisingly) /child.