伪静态,rewrite规则

要使用伪静态必须先设置重写模块,在前面的linux notes中有,windows配置:linkphp

Apache Rewrite 规则详解html

htaccess rewrite 规则详细说明正则表达式

‘redirect|R [=code]‘ (强制重定向 redirect)

‘forbidden|F’ (强制URL为被禁止的 forbidden)

‘last|L’ (最后一个规则 last)

‘nocase|NC’ (忽略大小写 no case)


正则表达式……痛,善用regex在线转换测试功能吧。http://tool.chinaz.com/regex
apache

:localhost/simple/home/test/aaawindows

转换localhost/simple/index.php?c=home&m=test&param=aaa测试

index.php同目录下新建.htaccessspa

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.net

相关文章
相关标签/搜索