I'm wondering how to disable the routing on laravel for a specific directory?
I am hoping to run my main website off of laravel (I'm rewriting it into the framework), but I'd like to retain my current forum software! The problem is, when laravel sees the "localhost/forums" it looks for a forums controller or route. I'd like it to simply go to the literal /forums directory..?
For a start it is using a named route. This means that the link between the form and its controller are not dictated by the url that the user sees. The next advantage is that you can pass additional parameters into the route helper and it will put those in the correct place in the form action.
The Default Route Files All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by your application's App\Providers\RouteServiceProvider . The routes/web.php file defines routes that are for your web interface.
Route is a way of creating a request URL of your application. These URLs do not have to map to specific files on a website. The best thing about these URLs is that they are both human readable and SEO friendly. In Laravel, routes are created inside the routes folder. Routes for the website are created in web.
I had to add this line in public/.htaccess
RewriteCond %{REQUEST_URI} !^/foldername
before this line (that redirects trailing slashes)
RewriteRule ^(.*)/$ /$1 [L,R=301]
With Laravel 4 none of these solutions were working for me. I eventually solved it by placing
RewriteRule ^(directory-name) - [L]
before
RewriteRule ^(.*)/$ /$1 [L,R=301]
in public/.htaccess
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With