Laravel slash after url redirects to root folder

后端 未结 5 603
梦谈多话
梦谈多话 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:44

    The following RewriteRule works for me. I had to remove the / in /$1 from alexrussel's answer above. Including the / redirects me to root folder.

    #For http://localhost/work/proj1/public/a/ RewriteBase is /work/proj1/public
    RewriteBase /repo/qs/public
    RewriteRule ^(.*)/$ $1 [L,R=301]
    

    I am using laravel v4.2, apache v2.4.7, php v5.5.9 on Linux Mint 17 64-bit.

提交回复
热议问题