Changeset 17715

Show
Ignore:
Timestamp:
09/26/08 12:43:08 (2 months ago)
Author:
rambo
Message:

make on MidCOM level (relatively) sure .html URLs are not used by 301:ing them to trailing-slash version, refs #47

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/midcom.core/midcom.php

    r15517 r17715  
    2727 * 
    2828 * This makes life much, much better when making static copies for whatever reason 
     29 * 
     30 * 2008-09-26: Now also rewrites urls ending in .html to end with trailing slash. 
    2931 */ 
    30 if (   !preg_match('%\?|/$|midcom-.+-|/.+\..+$%', $_SERVER['REQUEST_URI']) 
     32$redirect_test_uri = (string)$_SERVER['REQUEST_URI']; 
     33$redirect_test_uri = preg_replace('/\.html$/', '', $redirect_test_uri); 
     34if (   !preg_match('%\?|/$|midcom-.+-|/.+\..+$%', $redirect_test_uri) 
    3135    && (   !isset($_POST) 
    3236        || empty($_POST)) 
     
    3438{ 
    3539    header('HTTP/1.0 301 Moved Permanently'); 
    36     header("Location: {$_SERVER['REQUEST_URI']}/"); 
    37     echo "301: new location <a href='{$_SERVER['REQUEST_URI']}/'>{$_SERVER['REQUEST_URI']}/</a>"; 
     40    header("Location: {$redirect_test_uri}/"); 
     41    echo "301: new location <a href='{$redirect_test_uri}/'>{$redirect_test_uri}/</a>"; 
    3842    exit(); 
    3943} 
     44unset($redirect_test_uri); 
    4045 
    4146/** */ 
  • branches/MidCOM_2_8/midgard.admin.wizards/viewer.php

    r15981 r17715  
    208208                array 
    209209                ( 
    210                     MIDCOM_TOOLBAR_URL => 'config.html', 
     210                    MIDCOM_TOOLBAR_URL => 'config/', 
    211211                    MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('component configuration'), 
    212212                    MIDCOM_TOOLBAR_HELPTEXT => $this->_l10n_midcom->get('component configuration helptext'),