【发布时间】:2012-12-30 07:42:31
【问题描述】:
我正在编写一个脚本,我想制作如下链接:
www.mysite.com/sites/info/siteid
www.mysite.com/sites/edit/siteid
www.mysite.com/sites/delete/siteid
我知道我应该使用 RewriteRule。这是我的 .htaccess
RewriteEngine On
RewriteRule ^/?([a-z]+)$ $1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sites/(.*)$ sites.php?info=$1 [L]
所以,在 php 中,我想获取 /info 或 /edit 或 /delete,如 $_GET['info']; 等等。
另外,我想以同样的方式获得siteid
【问题讨论】: