【发布时间】:2013-06-26 08:59:20
【问题描述】:
我想要做的是缩短这个网址: example.com?controller=iphone&action=xyz
进入:
example.com/iphone/xyz
这是我尝试过但不起作用的方法:
.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/$ index.php?controller=$1&action=$2 [L]
【问题讨论】:
-
@Rikesh index.php 应该保留在 htaccess 中,它是路由脚本所在的位置。