Attached Files |
custom_url_ending.patch [^] (4,672 bytes) 2010-02-02 04:08
[Show Content]
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;
}
custom_url_ending_v2.patch [^] (5,170 bytes) 2010-04-25 12:33
[Show Content]
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 13400)
+++ install/install_data.sql (working copy)
@@ -32,6 +32,7 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'PageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', '', '', '', NULL, NULL, 0, 0, 0);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PathToWebsite', 'text', '', '', 10.01, 0, 1);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_use_modrewrite', 'checkbox', '', '', 10.02, 0, 1);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.03, 0, 0);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.04, 0, 0);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_nopermission_template', 'text', '', '', 10.05, 0, 0);
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 13400)
+++ install/upgrades.sql (working copy)
@@ -1651,6 +1651,8 @@
DELETE FROM Phrase WHERE Phrase LIKE 'la_event_%';
DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.';
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0);
+
UPDATE Category SET FormId = NULL WHERE FormId = 0;
INSERT INTO ConfigurationAdmin VALUES ('MemcacheServers', 'la_section_SettingsCaching', 'la_config_MemcacheServers', 'text', '', '', 80.01, 0, 0);
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 13400)
+++ kernel/application.php (working copy)
@@ -1833,13 +1833,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 13400)
+++ kernel/utility/unit_config_reader.php (working copy)
@@ -85,7 +85,6 @@
'SessionBrowserSignatureCheck',
'SessionIPAddressCheck',
'CookieSessions',
- 'SessionTimeout',
'KeepSessionOnBrowserClose',
'User_GuestGroup',
'User_LoggedInGroup',
@@ -101,6 +100,7 @@
// tracking related
'UseChangeLog',
'UseVisitorTracking',
+ 'ModRewriteUrlEnding',
'UseCronForRegularEvent',
);
Index: units/helpers/mod_rewrite_helper.php
===================================================================
--- units/helpers/mod_rewrite_helper.php (revision 13400)
+++ 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;
@@ -1020,6 +1030,8 @@
$this->Application->RewriteListeners[$prefix] = Array (&$listener, $listener_method);
}
+ define('MOD_REWRITE_URL_ENDING', $this->Application->ConfigValue('ModRewriteUrlEnding'));
+
$init_done = true;
}
custom_url_ending_v3.patch [^] (10,976 bytes) 2010-04-27 12:10
[Show Content]
Index: install/english.lang
===================================================================
--- install/english.lang (revision 13400)
+++ install/english.lang (working copy)
@@ -219,6 +219,7 @@
<PHRASE Label="la_config_FilenameSpecialCharReplacement" Module="Core" Type="1">RmlsZW5hbWUgU3BlY2lhbCBDaGFyIFJlcGxhY2VtZW50</PHRASE>
<PHRASE Label="la_config_first_day_of_week" Module="Core" Type="1">Rmlyc3QgRGF5IE9mIFdlZWs=</PHRASE>
<PHRASE Label="la_config_ForceImageMagickResize" Module="Core" Type="1">QWx3YXlzIHVzZSBJbWFnZU1hZ2ljayB0byByZXNpemUgaW1hZ2Vz</PHRASE>
+ <PHRASE Label="la_config_ForceModRewriteUrlEnding" Module="Core" Type="1">Rm9yY2UgUmVkaXJlY3QgdG8gU2VsZWN0ZWQgVVJMIEVuZGluZw==</PHRASE>
<PHRASE Label="la_config_force_http" Module="Core" Type="1">UmVkaXJlY3QgdG8gSFRUUCB3aGVuIFNTTCBpcyBub3QgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_config_FullImageHeight" Module="Core" Type="1">RnVsbCBpbWFnZSBIZWlnaHQ=</PHRASE>
<PHRASE Label="la_config_FullImageWidth" Module="Core" Type="1">RnVsbCBpbWFnZSBXaWR0aA==</PHRASE>
@@ -230,6 +231,7 @@
<PHRASE Label="la_config_MailingListQueuePerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFF1ZXVlIFBlciBTdGVw</PHRASE>
<PHRASE Label="la_config_MailingListSendPerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFNlbmQgUGVyIFN0ZXA=</PHRASE>
<PHRASE Label="la_config_MaxImageCount" Module="Core" Type="1">TWF4aW11bSBudW1iZXIgb2YgaW1hZ2Vz</PHRASE>
+ <PHRASE Label="la_config_ModRewriteUrlEnding" Module="Core" Type="1">RGVmYXVsdCBVUkwgRW5kaW5nIGluIFNFTy1mcmllbmRseSBtb2Rl</PHRASE>
<PHRASE Label="la_config_nopermission_template" Module="Core" Type="1">VGVtcGxhdGUgZm9yICJJbnN1ZmZpY2llbnQgUGVybWlzc2lvbnMiIEVycm9y</PHRASE>
<PHRASE Label="la_config_OutputCompressionLevel" Module="Core" Type="1">R1pJUCBjb21wcmVzc2lvbiBsZXZlbCAwLTk=</PHRASE>
<PHRASE Label="la_config_PathToWebsite" Module="Core" Type="1">UGF0aCB0byBXZWJzaXRl</PHRASE>
@@ -262,7 +264,7 @@
<PHRASE Label="la_config_UseToolbarLabels" Module="Core" Type="1">VXNlIFRvb2xiYXIgTGFiZWxz</PHRASE>
<PHRASE Label="la_config_UseVisitorTracking" Module="Core" Type="1">VXNlIFZpc2l0b3IgVHJhY2tpbmc=</PHRASE>
<PHRASE Label="la_config_use_js_redirect" Module="Core" Type="1">VXNlIEphdmFTY3JpcHQgcmVkaXJlY3Rpb24gYWZ0ZXIgbG9naW4vbG9nb3V0IChmb3IgSUlTKQ==</PHRASE>
- <PHRASE Label="la_config_use_modrewrite" Module="Core" Type="1">VXNlIE1PRCBSRVdSSVRF</PHRASE>
+ <PHRASE Label="la_config_use_modrewrite" Module="Core" Type="1">RW5hYmxlIFNFTy1mcmllbmRseSBVUkxzIG1vZGUgKE1PRC1SRVdSSVRFKQ==</PHRASE>
<PHRASE Label="la_config_use_modrewrite_with_ssl" Module="Core" Type="1">RW5hYmxlIE1PRF9SRVdSSVRFIGZvciBTU0w=</PHRASE>
<PHRASE Label="la_config_website_name" Module="Core" Type="1">V2Vic2l0ZSBuYW1l</PHRASE>
<PHRASE Label="la_config_YahooApplicationId" Module="Core" Type="1">WWFob28gQXBwbGljYXRpb25JZA==</PHRASE>
@@ -859,6 +861,7 @@
<PHRASE Label="la_Hide" Module="Core" Type="1">SGlkZQ==</PHRASE>
<PHRASE Label="la_hint_AllFiles" Module="Core" Type="1">QWxsIEZpbGVz</PHRASE>
<PHRASE Label="la_hint_CSVFiles" Module="Core" Type="1">Q1NWIEZpbGVz</PHRASE>
+ <PHRASE Label="la_hint_ForceModRewriteUrlEnding" Module="Core" Type="1">VXNlciB3aWxsIGJlIGF1dG9tYXRpY2FsbHkgcmVkaXJlY3RlZCB0byB0aGUgc2VsZWN0ZWQgVXJsIEVuZGluZyBpbiBjYXNlIHdoZW4gY3VycmVudCBwYWdlIHVybCBoYXMgYSBkaWZmZXJlbnQgZW5kaW5n</PHRASE>
<PHRASE Label="la_hint_ImageFiles" Module="Core" Type="1">SW1hZ2UgRmlsZXM=</PHRASE>
<PHRASE Label="la_hint_PopPort" Module="Core" Type="1">UE9QMyBTZXJ2ZXIgUG9ydC4gRm9yIGV4LiAiMTEwIiBmb3IgcmVndWxhciBjb25uZWN0aW9uLCAiOTk1IiBmb3Igc2VjdXJlIGNvbm5lY3Rpb24u</PHRASE>
<PHRASE Label="la_hint_PopServer" Module="Core" Type="1">UE9QMyBTZXJ2ZXIgQWRkcmVzcy4gRm9yIGV4LiB1c2UgInNzbDovL3BvcC5nbWFpbC5jb20iIGZvciBHbWFpbCwgInBvcC5tYWlsLnlhaG9vLmNvbSIgZm9yIFlhaG9vLg==</PHRASE>
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 13444)
+++ install/install_data.sql (working copy)
@@ -32,6 +32,8 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'PageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', '', '', '', NULL, NULL, 0, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PathToWebsite', 'text', '', '', 10.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_use_modrewrite', 'checkbox', '', '', 10.02, 0, 1, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.022, 0, 0, 'la_hint_ForceModRewriteUrlEnding');
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.03, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.04, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_nopermission_template', 'text', '', '', 10.05, 0, 0, NULL);
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 13444)
+++ install/upgrades.sql (working copy)
@@ -1799,3 +1799,10 @@
ALTER TABLE ConfigurationValues
ADD HintLabel VARCHAR(255) NULL DEFAULT NULL,
ADD INDEX (HintLabel);
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.022, 0, 0, 'la_hint_ForceModRewriteUrlEnding');
+
+UPDATE Phrase
+SET l<%PRIMARY_LANGUAGE%>_Translation = 'Enable SEO-friendly URLs mode (MOD-REWRITE)'
+WHERE Phrase = 'la_config_use_modrewrite' AND l<%PRIMARY_LANGUAGE%>_Translation = 'Use MOD REWRITE';
\ No newline at end of file
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 13400)
+++ kernel/application.php (working copy)
@@ -1833,13 +1833,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/http_query.php
===================================================================
--- kernel/utility/http_query.php (revision 13400)
+++ kernel/utility/http_query.php (working copy)
@@ -240,7 +240,7 @@
// if ($this->Application->RewriteURLs()) {
if ($this->Application->RewriteURLs() || $this->Get('_mod_rw_url_')) {
if (defined('DEBUG_MODE') && $this->Application->isDebugMode()) {
- $this->Application->Debugger->profileStart('url_parsing');
+ $this->Application->Debugger->profileStart('url_parsing', 'Parsing <b>MOD_REWRITE</b> url');
$this->processRewriteURL();
$description = 'Parsing <b>MOD_REWRITE</b> url (template: <b>'.$this->Get('t').'</b>)';
$this->Application->Debugger->profileFinish('url_parsing', $description);
Index: kernel/utility/unit_config_reader.php
===================================================================
--- kernel/utility/unit_config_reader.php (revision 13437)
+++ kernel/utility/unit_config_reader.php (working copy)
@@ -85,7 +85,6 @@
'SessionBrowserSignatureCheck',
'SessionIPAddressCheck',
'CookieSessions',
- 'SessionTimeout',
'KeepSessionOnBrowserClose',
'User_GuestGroup',
'User_LoggedInGroup',
@@ -101,6 +100,8 @@
// tracking related
'UseChangeLog',
'UseVisitorTracking',
+ 'ModRewriteUrlEnding',
+ 'ForceModRewriteUrlEnding',
'UseCronForRegularEvent',
);
Index: units/helpers/mod_rewrite_helper.php
===================================================================
--- units/helpers/mod_rewrite_helper.php (revision 13400)
+++ 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,22 @@
{
$passed = Array ();
$url = $this->HTTPQuery->Get('_mod_rw_url_');
- if (substr($url, -5) == '.html') {
- $url = substr($url, 0, strlen($url) - 5);
+
+ if ($url) {
+ foreach ($this->_urlEndings as $url_ending) {
+ if (substr($url, strlen($url) - strlen($url_ending)) == $url_ending) {
+ $url = substr($url, 0, strlen($url) - strlen($url_ending));
+ $default_ending = $this->Application->ConfigValue('ModRewriteUrlEnding');
+
+ // user manually typed url with different url ending -> redirect to same url with default url ending
+ if (($url_ending != $default_ending) && $this->Application->ConfigValue('ForceModRewriteUrlEnding')) {
+ $target_url = $this->Application->BaseURL() . $url . $default_ending;
+ $this->Application->Redirect('external:' . $target_url, Array ('response_code' => 301));
+ }
+
+ break;
+ }
+ }
}
$restored = false;
@@ -1020,6 +1041,8 @@
$this->Application->RewriteListeners[$prefix] = Array (&$listener, $listener_method);
}
+ define('MOD_REWRITE_URL_ENDING', $this->Application->ConfigValue('ModRewriteUrlEnding'));
+
$init_done = true;
}
incorrect_configuration_value_separator_fix.patch [^] (3,081 bytes) 2010-05-02 05:29
[Show Content]
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 13470)
+++ install/install_data.sql (working copy)
@@ -32,7 +32,7 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'PageHitCounter', '0', 'In-Portal', 'in-portal:configure_advanced', '', '', '', NULL, NULL, 0, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'Site_Path', '/', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PathToWebsite', 'text', '', '', 10.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseModRewrite', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_use_modrewrite', 'checkbox', '', '', 10.02, 0, 1, NULL);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+||/=+/||.html=+.html', 10.021, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.022, 0, 0, 'la_hint_ForceModRewriteUrlEnding');
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'cms_DefaultDesign', '#default_design#', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultDesignTemplate', 'text', NULL, NULL, 10.03, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ErrorTemplate', 'error_notfound', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_error_template', 'text', '', '', 10.04, 0, 0, NULL);
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 13470)
+++ install/upgrades.sql (working copy)
@@ -1804,7 +1804,7 @@
ADD HintLabel VARCHAR(255) NULL DEFAULT NULL,
ADD INDEX (HintLabel);
-INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+,/=+/,.html=+.html', 10.021, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ModRewriteUrlEnding', '.html', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ModRewriteUrlEnding', 'select', '', '=+||/=+/||.html=+.html', 10.021, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'ForceModRewriteUrlEnding', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_ForceModRewriteUrlEnding', 'checkbox', '', NULL, 10.022, 0, 0, 'la_hint_ForceModRewriteUrlEnding');
UPDATE Phrase
|