diff options
author | Ugnich Anton | 2014-07-09 14:58:14 +0700 |
---|---|---|
committer | Ugnich Anton | 2014-07-09 14:58:14 +0700 |
commit | 163c8632a5baff970805471a6168c5645c2db00f (patch) | |
tree | c1e1c372584cdd56f5631f5b340104e206a741b3 /src/java/com | |
parent | 7c9a7590f30873df16941057c59abdb4b8672836 (diff) |
Tags synonyms redirect
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/juick/http/www/Discover.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/java/com/juick/http/www/Discover.java b/src/java/com/juick/http/www/Discover.java index ff4b3ee5..ca78f41e 100644 --- a/src/java/com/juick/http/www/Discover.java +++ b/src/java/com/juick/http/www/Discover.java @@ -43,6 +43,14 @@ public class Discover { if (paramTag == null) { Errors.doGet404(sql, request, response); return; + } else if (paramTag.SynonymID > 0 && paramTag.TID != paramTag.SynonymID) { + com.juick.Tag synTag = TagQueries.getTag(sql, paramTag.SynonymID); + String url = "/tag/" + URLEncoder.encode(synTag.Name, "UTF-8"); + if (request.getQueryString() != null) { + url += "?" + request.getQueryString(); + } + Utils.sendPermanentRedirect(response, url); + return; } else if (!paramTag.Name.equals(paramTagStr)) { String url = "/tag/" + URLEncoder.encode(paramTag.Name, "UTF-8"); if (request.getQueryString() != null) { |