In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
454 [In-Portal CMS] Template System feature request always 2009-12-16 14:03 2010-07-22 15:06
alex  
alex  
normal  
closed 5.0.1  
fixed  
 
none 5.1.0-B1  
http://groups.google.com/group/in-portal-dev/browse_thread/thread/2912746dce829220
Option to select default URL ending for Pages
0
0000454: Customizable URL Endings for Mod-rewrite
Currently all mod-rewrite urls are ended with ".html". This is not quite
customizable. I propose to create a configuration variable e.g.
RewriteUrlEnding of dropdown type with such values: "" (empty), "/",
".html". To be more custom user could specify url ending for each url
individually using "url_ending" parameter of "m_Link" tag (e.g. <inp2:m_Link
template="path/to/template" url_ending="/"/>).

During parsing all possible rewrite url ending will be stripped from the end
of url before passing it to registered rewrite listeners. In case if
developer have specified it's own url ending (via "url_ending" parameter),
then of course it won't be stripped properly.
Proposed course of action:

1. Default URL Ending is config variable (drop-down options: ".html", "/", "empty")

2. Ability to force URL ending for HREF method with new Parameter passed to all Link building tags.

Example <inp2:m_Link template="path/to/template" url_ending="/"/> tag.
related to 0000049closed  (5.1.0)alex Merge ConfigurationAdmin and ConfigurationValues table 
related to 0000717closed  (5.1.0)alex Add ability to display hint labels for configuration variables 
related to 0000548closed  (5.1.0)alex Automatic mod-rewrite redirecting 
patch custom_url_ending.patch (4,672) 2010-02-02 04:08
http://tracker.in-portal.org/file_download.php?file_id=264&type=bug
patch custom_url_ending_v2.patch (5,170) 2010-04-25 12:33
http://tracker.in-portal.org/file_download.php?file_id=478&type=bug
patch custom_url_ending_v3.patch (10,976) 2010-04-27 12:10
http://tracker.in-portal.org/file_download.php?file_id=495&type=bug
patch incorrect_configuration_value_separator_fix.patch (3,081) 2010-05-02 05:29
http://tracker.in-portal.org/file_download.php?file_id=513&type=bug
Issue History
2010-07-22 15:06 alex Note Added: 0002535
2010-07-22 15:06 alex Status resolved => closed
2010-05-02 11:25 alex Reference Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/2912746dce829220 => http://groups.google.com/group/in-portal-dev/browse_thread/thread/2912746dce829220
2010-05-02 11:25 alex Status reviewed and tested => resolved
2010-05-02 11:25 alex Resolution reopened => fixed
2010-05-02 11:14 Dmitry Change Log Message Options to select default Page URL ending => Option to select default URL ending for Pages
2010-05-02 11:13 Dmitry Note Added: 0002045
2010-05-02 11:13 Dmitry Assigned To !COMMUNITY => alex
2010-05-02 11:13 Dmitry Status needs testing => reviewed and tested
2010-05-02 05:33 alex Relationship added related to 0000548
2010-05-02 05:32 alex Note Added: 0002042
2010-05-02 05:32 alex Assigned To alex => !COMMUNITY
2010-05-02 05:32 alex Status needs feedback => needs testing
2010-05-02 05:30 alex Changeset attached 5.1.x r13476
2010-05-02 05:29 alex File Added: incorrect_configuration_value_separator_fix.patch
2010-05-01 20:49 Dmitry Note Edited: 0002039 bug_revision_view_page.php?bugnote_id=0002039#r469
2010-05-01 20:44 Dmitry Note Added: 0002039
2010-05-01 20:44 Dmitry Status resolved => needs feedback
2010-05-01 20:44 Dmitry Resolution fixed => reopened
2010-04-28 06:29 alex Note Added: 0002009
2010-04-28 06:29 alex Status reviewed and tested => resolved
2010-04-28 06:29 alex Fixed in Version => 5.1.0-B1
2010-04-28 06:29 alex Resolution open => fixed
2010-04-28 06:29 alex Assigned To !COMMUNITY => alex
2010-04-28 06:29 alex Changeset attached 5.1.x r13454
2010-04-27 16:30 Dmitry Change Log Message Options to select Page URL ending => Options to select default Page URL ending
2010-04-27 16:30 Dmitry Change Log Message New functionality allowing to select Page URL ending => Options to select Page URL ending
2010-04-27 16:29 Dmitry Change Log Message => New functionality allowing to select Page URL ending
2010-04-27 16:22 Dmitry Note Added: 0001986
2010-04-27 16:22 Dmitry Status needs testing => reviewed and tested
2010-04-27 12:13 alex Note Added: 0001980
2010-04-27 12:13 alex Assigned To alex => !COMMUNITY
2010-04-27 12:13 alex Status needs work => needs testing
2010-04-27 12:10 alex File Added: custom_url_ending_v3.patch
2010-04-27 09:34 alex Relationship added related to 0000717
2010-04-26 07:49 Dmitry Assigned To Dmitry => alex
2010-04-26 07:49 Dmitry Status needs feedback => needs work
2010-04-26 07:49 Dmitry Note Added: 0001956
2010-04-26 04:53 alex Assigned To alex => Dmitry
2010-04-26 04:53 alex Note Added: 0001950
2010-04-25 20:08 Dmitry Note Added: 0001943
2010-04-25 20:08 Dmitry Assigned To !COMMUNITY => alex
2010-04-25 20:08 Dmitry Status needs testing => needs feedback
2010-04-25 12:34 alex Note Added: 0001927
2010-04-25 12:34 alex Assigned To alex => !COMMUNITY
2010-04-25 12:34 alex Status needs work => needs testing
2010-04-25 12:33 alex File Added: custom_url_ending_v2.patch
2010-04-25 11:51 Dmitry Note Added: 0001926
2010-04-25 11:51 Dmitry Assigned To !COMMUNITY => alex
2010-04-25 11:51 Dmitry Status needs testing => needs work
2010-02-27 04:21 alex Developer => alex
2010-02-02 16:46 Dmitry Relationship added related to 0000049
2010-02-02 16:46 Dmitry Note Added: 0001452
2010-02-02 04:09 alex Time Estimate Removed 3 =>
2010-02-02 04:09 alex Note Added: 0001448
2010-02-02 04:09 alex Assigned To => !COMMUNITY
2010-02-02 04:09 alex Status active => needs testing
2010-02-02 04:08 alex File Added: custom_url_ending.patch
2010-01-12 11:12 alex Time Estimate Added 3
2010-01-12 10:40 alex Target Version Icebox => 5.1.0
2009-12-16 14:04 Dmitry Reporter Dmitry => alex
2009-12-16 14:03 Dmitry Type bug report => feature request
2009-12-16 14:03 Dmitry New Issue
2009-12-16 14:03 Dmitry Reference => Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/2912746dce829220

Notes
(0001448)
alex   
2010-02-02 04:09   
1. need to translate la_config_ModRewriteUrlEnding phrase
2. consider other, then ".html" as default ending
3. consider using "/" url ending for category links (via c_CategoryLink tag)
(0001452)
Dmitry   
2010-02-02 16:46   
NOTE

Once tested need to remember to convert this patch to use ConfigurationValues table ONLY completed in 0000049 Merge ConfigurationAdmin and ConfigurationValues table
(0001926)
Dmitry   
2010-04-25 11:51   
Patch can't be applied - please update.
(0001927)
alex   
2010-04-25 12:34   
Done. Please test.
(0001943)
Dmitry   
2010-04-25 20:08   
This has been tested good!

Additional question

I think it might make sense to send 404 when I am trying to access

http://www.jurmala.com/SVN/in-portal-5.1.x/in-bulletin/my_account/my_topics

via other URL ending (not the active one), example:

http://www.jurmala.com/SVN/in-portal-5.1.x/in-bulletin/my_account/my_topics.html
http://www.jurmala.com/SVN/in-portal-5.1.x/in-bulletin/my_account/my_topics/

The main reason why is that it can be considered a Duplication URLs.

Or even better do a 302 redirect to the correct URL.


Please comment.
(0001950)
alex   
2010-04-26 04:53   
What about case, when use uses "url_ending" parameter in "<inp2:m_Link" tag? If we do like you propose, then there is no need to such "url_ending" parameter, since it will never work because of proposed redirect.

For example if I want all category links to end up with "/", but all other links with ".html".
(0001956)
Dmitry   
2010-04-26 07:49   
Performing voting for this http://groups.google.com/group/in-portal-dev/browse_thread/thread/79fcf649bbd0768f
(0001980)
alex   
2010-04-27 12:13   
New option was added (off by default). New patch attached. Also 3 phrases were added:

Config Variable Name: Default URL Ending in SEO-friendly mode
Config Variable Name: Force Redirect to Selected URL Ending
Config Variable Hint: User will be automatically redirected to the selected Url Ending in case when current page url has a different ending

Also translation of phrase for "UseModRewrite" configuration variable was changed.

Please Test.
(0001986)
Dmitry   
2010-04-27 16:22   
Tested good!

Had to merge some things in http_query.php, but it worked well.
(0002009)
alex   
2010-04-28 06:29   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0000454: Customizable URL Endings for Mod-rewrite
(0002039)
Dmitry   
2010-05-01 20:44   
(edited on: 2010-05-01 20:49)
There are 2 little bugs:

1. in Install_data.sql. Please adjust , to || for ConfigurationValues

http://source.in-portal.org/in-portal/branches/5.1.x/core/install/install_data.sql?r1=13453&r2=13454&pathrev=13454


2. when I select Force URL End Redirect and I enter the website:

http://www.jurmala.com/SVN/in-portal-5.1.x (or http://www.jurmala.com/SVN/in-portal-5.1.x/)

I get redirected to:

http://www.jurmala.com/SVN/in-portal-5.1.x/index/

This should NOT happen for Index page I think, at least we should not add "index".

(0002042)
alex   
2010-05-02 05:32   
1. done in "incorrect_configuration_value_separator_fix.patch" (already commited) patch. Please test.

2. Was part of 0000548 task specs. All questions should be addressed to it.
(0002045)
Dmitry   
2010-05-02 11:13   
Reviewed, please commit.
(0002535)
alex   
2010-07-22 15:06   
Closing, since 5.1.0 release has been released.