Laravel slash after url redirects to root folder

后端 未结 5 598
梦谈多话
梦谈多话 2020-12-18 08:02

I\'m new to Laravel and it seems a great framework but i have a question when it comes to routing. I want to route all get requests to one controller action named PageContro

5条回答
  •  心在旅途
    2020-12-18 08:46

    If you know the directory name, make a rule for it. This works fine for me:

    
       
           Options -MultiViews
       
    
       RewriteEngine On
    
       RewriteRule ^(forum)($|/) - [L]
    
       # Redirect Trailing Slashes...
       RewriteRule ^(.*)/$ /$1 [L,R=301]
    
       # Handle Front Controller...
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^ index.php [L]
    
    

提交回复
热议问题