Simple MVC mod-rewrite

前端 未结 2 731
既然无缘
既然无缘 2020-12-19 11:28

I\'m not sure how to do a mod-rewrite for a modular MVC structure. What I want to happen is the URL captures:

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 11:50

    You could also have your htaccess like this:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/(.*)/(.*) mvc.php?model=$1&view=$2¶meters=$3 [L,NS]
    

    This is just another way to do it, although personally I prefer streetpc's way.

提交回复
热议问题