我在.htaccess中创建重写规则
我有一些问题,我正在创建像wordpress一样的规则,但我没有正确
我写的规则在
之下`RewriteRule projectDir/(.*)/(.*)/(.*)$ index.php?module=$1&action=$2&id=$3`
在这个ReFacta中是我的项目目录
我想要的网址如下所示
`http://localhost/projectDir/user/edit/5`
知道朋友吗?
答案 0 :(得分:4)
你几乎是对的。你的代码有什么问题,你没有指定RewriteBase
Options +FollowSymLinks
RewriteEngine on
RewriteBase /projectDir
RewriteRule ^(.*)/(.*)/(.*)$ /index.php?module=$1&action=$2&id=$3 [L]