我使用自己的php mvc我的htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
网站的URL如下:
test.com/blog/index/1
数字1:ID是数据库的列 如何从MVC网址中删除索引
谢谢
答案 0 :(得分:0)
我是这样的
RewriteEngine on
#in case of SSL
#RewriteCond %{HTTPS} !=on
#RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond $1 !^(index\.php|public|\.txt|assets/images/fav/favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1