From 917a91eb40fe1f5e2205ffd710b73a33d15d7647 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 4 Dec 2014 16:38:58 -0500 Subject: [PATCH] FIX: permalink redirect support for url's with extensions in them, like .html and .php --- app/controllers/permalinks_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/permalinks_controller.rb b/app/controllers/permalinks_controller.rb index b54e59fb7..c32b88e96 100644 --- a/app/controllers/permalinks_controller.rb +++ b/app/controllers/permalinks_controller.rb @@ -2,8 +2,7 @@ class PermalinksController < ApplicationController skip_before_filter :check_xhr, :preload_json def show - url = params[:url] - url = "#{url}?#{request.query_string}" if request.query_string.present? + url = request.fullpath[1..-1] permalink = Permalink.find_by_url(url) if permalink && permalink.target_url redirect_to permalink.target_url, status: :moved_permanently