So, I have 4 folders in my public folder: js, css, images, fonts (yes, i should put all in one folder). I also have a route which is pointing to an /images page. The problem is, when I open the images page, it throws a 404 error. Are there any solutions for this, or I have to rename the folder or the page. (The page names will be dynamic, so if the user creates a page named "anotherPage" it will be /anotherpage.)
routes.php
Route::get('/{pagename?}', 'PageController@index');
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
If i understand your question correctly.
You can have same name as your folders BUT, if a file with name upload
exist within the folder upload
(upload/upload.ext). It will always direct to folder not the file and try to get upload/index.ext
.
This is a default yet confusing behavior which can lead to ambiguous results. Never use same folder names and files.
The route for the images page must be defined before the {pagename} route.