[solved] Help with .htaccess

#1
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:

NiteWave

Administrator
#2
tested with RedirectMatch, it works itself.

you may miss '*' or '+', look below:
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
 
Top