【发布时间】:2013-07-25 14:22:05
【问题描述】:
我正在使用 htaccess 清理 URL,以下是个人资料页面的规则
RewriteRule ^([0-9a-z]+)$ profile.php?user=$1
但我还有其他页面,例如关注者,关注登录用户,他们可以在 /followers 页面上看到他们的关注者,此规则是
RewriteRule ^following$ follow.php?follow=following
RewriteRule ^followers$ follow.php?follow=followers
但是当我转到/followers 时,我会被重定向到profile.php(上面的第一条规则),正如您在第一条规则中看到的那样,域名localhost/text_that_comes_here 转到profile.php 之后的任何内容
有什么办法可以让我的/followers 和其他页面正确重定向。
【问题讨论】:
标签: regex apache .htaccess url-rewriting