? Success

User tests: Successful: Unsuccessful:

avatar matrikular
matrikular
29 May 2016

Introduction

The current implementation of the redirect application (component and plugin) expects a direct match to act uppon. So, if one wants to manually add a "rewrite rule" for e.g. http(s)://www.domain.tld/path/some-alias?some=param the rule would have to be exactly that url.

There are a couple of scenarios where query params could be added to any url, like when using a newsletter tool or if you've implemented certain affiliate mechanisms, where, especially in case of a relaunch of a website, you would have to create a whole bunch of redirect rules for each and every newsletter and / or affliiate link. Seldom this amount of different redirects can or should be handled via rewrite rules in a .htacces file.

This PR will add to the default behavior in a way that, if no specific (and published) redirect rule was found, it keeps looking for a "fallback".

Here is an example (behavior without the patch).:
If no (published) redirect rule for http(s)://www.domain.tld/path/some-alias?some=param exists, it will lead to a 404 status code.

After the patch, the plugin would also find http(s)://www.domain.tld/path/some-alias and would append the missing params automatically to the redirect url.

Summary of Changes

  • Removed unnecessary comment blocks e.g.$app = JFactory::getApplication(); or $uri = JUri::getInstance();are common practice and should not need to be explained.
  • "Reduced" the database access, refactored the insert / update methods and added separate try / catch blocks to support different error messages for both operations. I've also changed the error code in the catch block from 404 to 500 since in case of an error there, we're not dealing with a 404 anymore.

Testing Instructions

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar matrikular matrikular - open - 29 May 2016
avatar matrikular matrikular - change - 29 May 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 29 May 2016
Category Router / SEF
avatar andrepereiradasilva andrepereiradasilva - test_item - 29 May 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 29 May 2016

I have tested this item successfully on 53b4277

followed test instructions and worked fine.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10670.

avatar chmst chmst - test_item - 29 May 2016 - Tested successfully
avatar chmst
chmst - comment - 29 May 2016

I have tested this item successfully on 53b4277

I've tested this successfully. Works as described, very useful!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10670.

avatar zero-24 zero-24 - change - 30 May 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 30 May 2016

RTC based on testing thanks ????


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10670.

avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 30 May 2016
Milestone Added:
avatar zero-24
zero-24 - comment - 30 May 2016

Sorry the ???? was not expected ???? I have just commented from my phone and i maybe hit the wrong button ;)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10670.

avatar wilsonge wilsonge - change - 30 May 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-05-30 22:57:24
Closed_By wilsonge
avatar wilsonge wilsonge - close - 30 May 2016
avatar wilsonge wilsonge - merge - 30 May 2016
avatar joomla-cms-bot joomla-cms-bot - close - 30 May 2016
avatar wilsonge wilsonge - reference | fc02236 - 30 May 16
avatar wilsonge wilsonge - merge - 30 May 2016
avatar wilsonge wilsonge - close - 30 May 2016
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2016
Labels Removed: ?
avatar wilsonge
wilsonge - comment - 30 May 2016

Merged - thanks!

avatar matrikular matrikular - change - 22 May 2017
The description was changed
avatar matrikular matrikular - edited - 22 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 22 May 2017
Category Router / SEF Front End Plugins Router / SEF

Add a Comment

Login with GitHub to post a comment