Add Trailing Slash for MVC Application

前端 未结 1 1937
孤独总比滥情好
孤独总比滥情好 2021-01-28 19:11

I\'m building an application based on the MVC design pattern, and I want my URLS to be like: http://example.com/page/action/. I successfully got it to work with the code below,

相关标签:
1条回答
  • 2021-01-28 19:46
    RewriteEngine on
    
    RewriteBase /
    
    RewriteCond %{REQUEST_URI} !/$
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule (.*) $1/ [R=301,L,QSA]
    
    0 讨论(0)
提交回复
热议问题