Support the ongoing development of Laravel.io →
Configuration
Last updated 1 year ago.
0

this solved my problem

not sure if its a bad idea or not but it works

RewriteEngine On

 RewriteCond %{REQUEST_URI} ^/admin
 RewriteRule ^ index.php [L]

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Last updated 1 year ago.
0

Your route should not be broken. Routes are used only when the file exists in the public folder.

EDIT Im wrong :) it checks for the folder too. Anyway that would be better that you rename your files or your admin route than hacking the .htaccess. In the long run it will be better to stick to the conventions. Just my opinion. :)

Last updated 1 year ago.
0

The route is not called since apache tries to give me the folder/file named exactly the same as my route (in public folder).

i just added an extra bit of code in .htaccess before checking if the request matches a directory or a file and solved this.

a bit hacky solution but works

Last updated 1 year ago.
0

If nothing else, the fact that changing one folder in your public directory would require hundreds of separate changes means you have good idea of a place to refactor. ;)

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

unitedworx unitedworx Joined 25 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.