[solved] Help with .htaccess

Discussion in 'General' started by morrisqueto, Apr 21, 2012.

  1. morrisqueto

    morrisqueto New Member

    I wanto to redirec all pages that starts with _ on /tag

    For example
    http://www.domain.com/tag/_rima.html

    redirect to
    http://www.domain.com/tag/rima.html

    I tried with this

    Code:
    RedirectMatch 301 tag/_([a-zA-Z0-9])-([0-9]+).html http://www.domain.com/tag/$1-$2.html
    RedirectMatch 301 tag/_([a-zA-Z0-9]).html http://www.domain.com/tag/$1.html
    
    Here is my .htaccess

    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    Rewriterule ^busqueda/(.*)$ index.php?special=search&search=$1 [L]
    Rewriterule ^index.html$ index.php [L]
    Rewriterule ^contacto.html$ index.php?special=contacto [L]
    Rewriterule ^sitemap.html$ index.php?special=sitemap [L]
    Rewriterule ^mapadelsitio.html$ index.php?special=sitemap [L]
    Rewriterule ^error-(.*).html$ index.php?special=error&error=$1 [L]
    Rewriterule ^feed.xml$ feed.php [L]
    Rewriterule ^sitemap.xml$ sitemap.php [L]
    Rewriterule ^crear-(.*)-([0-9]+).html$ index.php?wizard=$1&step=$2 [L]
    Rewriterule ^crear-(.*)-en_linea.html$ index.php?wizard=$1 [L]
    Rewriterule ^crear-(.*).html$ index.php?wizard=$1 [L]
    
    Rewriterule ^tag/(.*)-([0-9]+).html$ index.php?tag=$1&tagpage=$2 [L]
    Rewriterule ^tag/(.*).html$ index.php?tag=$1 [L]
    
    Rewriterule ^(.*)/([0-9]+)-(.*).html$ index.php?page=$2 [L]
    
    Rewriterule ^([0-9]+)-(.*)/$ index.php?category=$1 [L]
    Rewriterule ^([0-9]+)-(.*)$ index.php?category=$1 [L]
    Rewriterule ^ejemplos-(.*)/$ index.php?category2=$1 [L]
    Rewriterule ^ejemplos-(.*)$ index.php?category2=$1 [L]
    Rewriterule ^uploads/(.*)$ descargar.php?filename=$1 [L]
    </IfModule>
    Thanks
    Last edited by a moderator: Apr 23, 2012
  2. NiteWave

    NiteWave Administrator

    tested with RedirectMatch, it works itself.

    you may miss '*' or '+', look below:
  3. morrisqueto

    morrisqueto New Member

    Thanks it works :)

Share This Page