要使用伪静态必须先设置重写模块,在前面的linux notes中有,windows配置:link
‘redirect|R [=code]‘ (强制重定向 redirect)
‘forbidden|F’ (强制URL为被禁止的 forbidden)
‘last|L’ (最后一个规则 last)
‘nocase|NC’ (忽略大小写 no case)
正则表达式……痛,善用regex在线转换测试功能吧。http://tool.chinaz.com/regex
源:localhost/simple/home/test/aaa
转换:localhost/simple/index.php?c=home&m=test¶m=aaa
index.php同目录下新建.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^index\?c=([a-z]{1,})&m=([a-z]{1,})$ index.php?c=$1&m=$2
(.*)可以搭配任何……
Htaccess Rewrites - Rewrite Tricks and Tips
来源:oschina
链接:https://my.oschina.net/u/2331171/blog/550591