In-Portal Issue Tracker - In-Portal CMS
|
Viewing Issue Advanced Details |
|
ID:
|
Category:
|
Type:
|
Reproducibility:
|
Date Submitted:
|
Last Update:
|
1433 |
[In-Portal CMS] Front End |
task |
always |
2012-11-05 11:09 |
2012-12-13 02:57 |
|
Reporter:
|
alex |
Platform:
|
|
|
Assigned To:
|
alex |
OS:
|
|
|
Priority:
|
normal |
OS Version:
|
|
|
Status:
|
resolved |
Product Version:
|
5.2.0 |
|
Product Build:
|
|
Resolution:
|
fixed |
|
|
ETA:
|
none |
Fixed in Version:
|
5.3.0-B1 |
|
Reference:
|
https://groups.google.com/d/topic/in-portal-bugs/_PqTRECoiHk/discussion |
Change Log Message:
|
Fixes multiple urls pointing to a single page problem |
Estimate Points:
|
1 |
|
Summary:
|
0001433: Possibility of having 2 urls to a single page |
Description:
|
In https://groups.google.com/d/topic/in-portal-bugs/xwFIs71lt38/discussion discussion I've talked about physical and virtual sections and fact, that 2 urls exists to a single physical section.
At first this might not seem a big problem, especially if across a theme "use_section" parameter of m_Link tag is used, which forces url from "Structure & Data" section to be used.
However if user manually guesses url to a TPL file, which is behind "Structure & Data" section url, then page will be shown too.
If google spider guess that url, then website could be banned because 2 different urls result in showing same page at all times.
I propose to automatically redirect (with 301 Moved Permanently http code) visitor to page url equivalent from "Structure & Data" section and put a notice into "System Log".
This way developers would know that somebody still accesses old page url. And using HTTP_REFERER header they would know exactly who that might be. |
Steps To Reproduce:
|
|
Additional Information:
|
Enable proposed functionality with a setting, that is turned off by default. |
Relationships | |
Attached Files:
|
2_urls_to_single_page_1433.patch (5,438) 2012-12-05 10:44 http://tracker.in-portal.org/file_download.php?file_id=1879&type=bug
2_urls_to_single_page_1433_v2.patch (5,409) 2012-12-06 12:43 http://tracker.in-portal.org/file_download.php?file_id=1885&type=bug
2_urls_to_single_page_1433_v3.patch (6,035) 2012-12-11 04:06 http://tracker.in-portal.org/file_download.php?file_id=1889&type=bug
2_urls_to_single_page_1433_v4.patch (7,498) 2012-12-13 02:54 http://tracker.in-portal.org/file_download.php?file_id=1895&type=bug |
|
Issue History |
Date Modified |
Username |
Field |
Change |
2012-12-13 02:57 |
alex |
Note Added: 0005342 |
|
2012-12-13 02:57 |
alex |
Status |
reviewed and tested => resolved |
2012-12-13 02:57 |
alex |
Fixed in Version |
=> 5.3.0-B1 |
2012-12-13 02:57 |
alex |
Resolution |
open => fixed |
2012-12-13 02:57 |
alex |
Changeset attached |
5.3.x r15652 |
2012-12-13 02:56 |
alex |
Note Added: 0005341 |
|
2012-12-13 02:56 |
alex |
Status |
needs testing => reviewed and tested |
2012-12-13 02:54 |
alex |
File Added: 2_urls_to_single_page_1433_v4.patch |
|
2012-12-11 04:07 |
erik |
Note Added: 0005333 |
|
2012-12-11 04:07 |
erik |
Assigned To |
erik => alex |
2012-12-11 04:07 |
erik |
Status |
needs work => needs testing |
2012-12-11 04:06 |
erik |
File Added: 2_urls_to_single_page_1433_v3.patch |
|
2012-12-11 03:06 |
alex |
Note Added: 0005332 |
|
2012-12-11 03:06 |
alex |
Assigned To |
alex => erik |
2012-12-11 03:06 |
alex |
Status |
needs testing => needs work |
2012-12-06 12:44 |
erik |
Note Added: 0005325 |
|
2012-12-06 12:44 |
erik |
Assigned To |
erik => alex |
2012-12-06 12:44 |
erik |
Status |
needs work => needs testing |
2012-12-06 12:43 |
erik |
File Added: 2_urls_to_single_page_1433_v2.patch |
|
2012-12-06 04:10 |
alex |
Note Added: 0005319 |
|
2012-12-06 04:10 |
alex |
Assigned To |
alex => erik |
2012-12-06 04:10 |
alex |
Status |
needs testing => needs work |
2012-12-05 10:44 |
erik |
Note Added: 0005317 |
|
2012-12-05 10:44 |
erik |
Assigned To |
=> alex |
2012-12-05 10:44 |
erik |
Developer |
=> erik |
2012-12-05 10:44 |
erik |
Status |
active => needs testing |
2012-12-05 10:44 |
erik |
File Added: 2_urls_to_single_page_1433.patch |
|
2012-12-05 03:11 |
alex |
Note Added: 0005313 |
|
2012-12-05 02:43 |
alex |
Description Updated |
bug_revision_view_page.php?rev_id=1066#r1066 |
2012-11-05 11:09 |
alex |
New Issue |
|
2012-11-05 11:09 |
alex |
Reference |
=> https://groups.google.com/d/topic/in-portal-bugs/_PqTRECoiHk/discussion |
2012-11-05 11:09 |
alex |
Change Log Message |
=> Fixes multiple urls pointing to a single page problem |
2012-11-05 11:09 |
alex |
Estimate Points |
=> 1 |
Notes |
|
(0005313)
|
alex
|
2012-12-05 03:11
|
|
Plan:
1. add new system setting "ForceCanonicalUrls" ("Force Canonical Urls") into "Configuration -> Website -> Advanced" section after "Force Redirect to Selected URL Ending" setting
1a. try using new "Add" button to ease system setting adding and then dump INSERT statement into install_data.sql/upgrades.sql file
2. create getSeoTemplate method in kUrlManager class (+ create facade method in kApplication class, like it's one with getPhysicalTemplate method), that will use "structureTemplateMapping" array (see getPhysicalTemplate method for example) to figure out given template's underlying TPL file (be careful, because that array has info about multiple themes in them; only match current theme).
3. add new check to the end of kHTTPQuery::AfterInit method code where parsed template will be given to kApplication::getSeoTemplate method and it turns out that real TPL path is present in url + setting enabled + has seo url do redirect to that seo url.
4. test with both mod-rewrite enabled and disabled
5. try putting TPL path into url, that is listed in ".smsignore" file - no redirect loop should happen
6. use trigger_error method to create notice about redirects performed this way; System Log will catch them automatically, when it's present. |
|
|
(0005317)
|
erik
|
2012-12-05 10:44
|
|
Patch attached. Needs testing |
|
|
(0005319)
|
alex
|
2012-12-06 04:10
|
|
1. method getSeoTemplate accepts physical templates as input and that's why it's parameter should be called $physical_template and not a $parsed_template
2. this is no need for preg_match('|' . BASE_PATH check in kHTTPQuery::AfterInit method, because method getSeoTemplate will return empty string in case when we're on right seo template and not on physical one (should be done as I written in plan if this won't break anything)
3. no point in giving both "use_section" redirect parameter & seo_template to kApplication::Redirect method call, because:
- with seo template given url will be to seo template
- with empty string given + use_section parameter url will also be to seo template
- with seo template given + use_section parameter the use_section parameter will have no effect
Choose any of 3 proposed solutions in item 3.
4. getRedirectParams method not used (as in code before added code) and it will result in any extra url parameters passed to wrong url (from where we're doing a redirect) will be lost (e.g. "next_template" and so on) resulting in non working page displayed to user |
|
|
(0005325)
|
erik
|
2012-12-06 12:44
|
|
Patch version 2 attached. Needs testing |
|
|
(0005332)
|
alex
|
2012-12-11 03:06
|
|
|
|
(0005333)
|
erik
|
2012-12-11 04:07
|
|
Added insert-sql for new SystemSettings in upgrades.sql
New patch attached. Needs testing. |
|
|
(0005341)
|
alex
|
2012-12-13 02:56
|
|
Works in general, but some minor issues fixed:
1. code was working in Admin Console but wasn't actually doing anything useful because admin template isn't listed |
|
|
(0005342)
|
alex
|
2012-12-13 02:57
|
|
Fix committed to 5.3.x branch. Commit Message:
Fixes 0001433: Possibility of having 2 urls to a single page
1. Commit on behalf of Erik |
|