aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-07-09 14:58:14 +0700
committerGravatar Ugnich Anton2014-07-09 14:58:14 +0700
commit163c8632a5baff970805471a6168c5645c2db00f (patch)
treec1e1c372584cdd56f5631f5b340104e206a741b3 /src/java/com/juick/http
parent7c9a7590f30873df16941057c59abdb4b8672836 (diff)
Tags synonyms redirect
Diffstat (limited to 'src/java/com/juick/http')
-rw-r--r--src/java/com/juick/http/www/Discover.java8
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) {