Index: install/install_data.sql =================================================================== --- install/install_data.sql (revision 13151) +++ install/install_data.sql (working copy) @@ -59,6 +59,8 @@ INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('UseModRewrite', 'la_section_SettingsWebsite', 'la_config_use_modrewrite', 'checkbox', '', '', 10.02, 0, 1); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_advanced'); +INSERT INTO ConfigurationAdmin VALUES ('ModRewriteUrlEnding', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('cms_DefaultDesign', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.03, 0, 0); INSERT INTO ConfigurationValues VALUES (DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced'); INSERT INTO ConfigurationAdmin VALUES ('ErrorTemplate', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.04, 0, 0); Index: install/upgrades.sql =================================================================== --- install/upgrades.sql (revision 13151) +++ install/upgrades.sql (working copy) @@ -1650,3 +1650,6 @@ DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%'; DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.'; + +INSERT INTO ConfigurationAdmin VALUES ('ModRewriteUrlEnding', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0); +INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced'); Index: kernel/application.php =================================================================== --- kernel/application.php (revision 13128) +++ kernel/application.php (working copy) @@ -1707,13 +1707,12 @@ // remove tempporary parameters used by listeners unset($params['t'], $params['inject_parts'], $params['pass_template'], $params['pass_category'], $params['category_processed']); - if ($catalog_item_found || !$cat_processed || !defined('EXP_DIR_URLS')) { - // this catalog item detail page OR there is no category given - $ret = trim($ret, '/') . '.html'; + if (array_key_exists('url_ending', $params)) { + $ret = trim($ret, '/') . $params['url_ending']; + unset($params['url_ending']); } else { - // url ends with "/" and not with ".html" - $ret = trim($ret, '/') . '/'; + $ret = trim($ret, '/') . MOD_REWRITE_URL_ENDING; } if ($env) { Index: kernel/utility/unit_config_reader.php =================================================================== --- kernel/utility/unit_config_reader.php (revision 13128) +++ kernel/utility/unit_config_reader.php (working copy) @@ -87,7 +87,6 @@ 'UseCronForRegularEvent', 'User_GuestGroup', 'User_LoggedInGroup', - 'SessionTimeout', 'UseModRewrite', 'UseOutputCompression', 'OutputCompressionLevel', @@ -96,6 +95,7 @@ 'Config_Site_Time', 'UseChangeLog', 'UseVisitorTracking', + 'ModRewriteUrlEnding', ); foreach ($config_vars as $var) { Index: units/helpers/mod_rewrite_helper.php =================================================================== --- units/helpers/mod_rewrite_helper.php (revision 13128) +++ units/helpers/mod_rewrite_helper.php (working copy) @@ -45,6 +45,13 @@ var $_templateAliases = null; /** + * Possible url endings from ModRewriteUrlEnding configuration variable + * + * @var Array + */ + var $_urlEndings = Array ('.html', '/'); + + /** * Constructor of kModRewriteHelper class * * @return kModRewriteHelper @@ -60,8 +67,11 @@ { $passed = Array (); $url = $this->HTTPQuery->Get('_mod_rw_url_'); - if (substr($url, -5) == '.html') { - $url = substr($url, 0, strlen($url) - 5); + + foreach ($this->_urlEndings as $url_ending) { + if (substr($url, (-1) * strlen($url_ending)) == $url_ending) { + $url = substr($url, 0, strlen($url) - strlen($url_ending)); + } } $restored = false; @@ -949,6 +959,8 @@ $this->Application->RewriteListeners[$prefix] = Array (&$listener, $listener_method); } + define('MOD_REWRITE_URL_ENDING', $this->Application->ConfigValue('ModRewriteUrlEnding')); + $init_done = true; }