Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorlugano
    • CommentTimeAug 10th 2010 edited
     permalink
    Hi all,

    I need to force the bar "/" at the end of the url : duplicate page
    Example:
    http://zeuder.com.ar/category/recursos-webmaster/ = http://zeuder.com.ar/category/recursos-webmaster
    or:
    http://zeuder.com.ar/2009/11/16/la-inspiracion-es-contagiosa/ = http://zeuder.com.ar/2009/11/16/la-inspiracion-es-contagiosa/

    Any solution to this? ...
    thank you very much.
    The example is a Web page that read and use inspiration

    EDIT:
    http://fucoder.com/code/permalink-redirect/ here any plugin WP... or
    htaccess rules:
    Options +Indexes
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^myblog\.com
    RewriteRule ^(.*)$ http://www.myblog.com/$1 [R=permanent,L]

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://www.myblog.com/$1/ [L,R=301]
    more: http://www.adseok.com/wordpress/seo-para-wordpress-urls-y-permalinks/#ixzz0w9r4cA7j...
    Work in FP?... thanks again.
    •  
      CommentAuthorNoWhereMan
    • CommentTimeAug 10th 2010
     permalink
    I guess it should work
    •  
      CommentAuthorlugano
    • CommentTimeAug 10th 2010 edited
     permalink
    Hi NoWhereMan, can you give an example of how to adapt to flatpress:
    I tried some rules htaccess and did not work.
    # If no slash at the end, put a - no work!
    RewriteCond %{REQUEST_URI} !(\.[^/]*|/)$
    RewriteRule ^(.*[^/])$ /$1/ [R=301,L]
    # Eliminates multiple slash, and put one - work!
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)/{2,}\ HTTP/
    RewriteRule ^(.*)$ /%1/ [R=301,L]
    Thank you very much.
    •  
      CommentAuthorlugano
    • CommentTimeAug 13th 2010 edited
     permalink
    Hi...this code, slash forces at end of url.
    For the moment does not work with static pages...
    working: test any expert to work with static pages... please.

    <?php
    $queryString = $_SERVER['QUERY_STRING'];
    if(!$queryString){
    $requestUri = $_SERVER['REQUEST_URI'];
    $uriArr = explode('#', $requestUri);
    $requestUriFragment = $uriArr[1];
    $requestUriBase = $uriArr[0];
    $uriArr = explode('?', $requestUriBase);
    $requestUriBase = $uriArr[0];
    if ( substr($requestUriBase, strlen($requestUriBase) -1, 1) != '/' ) {
    $canonicaIUrl = 'http://'.$_SERVER['SERVER_NAME'];
    $canonicalUrl .= $requesIUriBase .'/';
    @header('HTTP/1.1 301 Moved Permanently', TRUE, 301);
    @header('Location:'.$canonicalUrl);
    exit;
    }
    }
    ?>