summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-12-03 12:46:46 -0500
committerEvan Prodromou <evan@controlyourself.ca>2008-12-03 12:46:46 -0500
commit63500f10f8c614a0e356e85b1704afc16f97425a (patch)
treea46edbd7e73ffa8ea38b34885e0ea8cc008132bf /actions
parentb7385b23068ea794ebd24db28b214945054563b5 (diff)
permanent redirect on non-canonical nickname
darcs-hash:20081203174646-5ed1f-8f9f050a7e8c217872c283f299d790252c205920.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/showstream.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/actions/showstream.php b/actions/showstream.php
index 38b87ad1d..4cf216566 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -30,7 +30,20 @@ class ShowstreamAction extends StreamAction {
parent::handle($args);
- $nickname = common_canonical_nickname($this->arg('nickname'));
+ $nickname_arg = $this->arg('nickname');
+ $nickname = common_canonical_nickname($nickname_arg);
+
+ # Permanent redirect on non-canonical nickname
+
+ if ($nickname_arg != $nickname) {
+ $args = array('nickname' => $nickname);
+ if ($this->arg('page') && $this->arg('page') != 1) {
+ $args['page'] = $this->arg['page'];
+ }
+ common_redirect(common_local_url('showstream', $args), 301);
+ return;
+ }
+
$user = User::staticGet('nickname', $nickname);
if (!$user) {