Forum Moderators: phranque

Message Too Old, No Replies

small question about redirect process

         

tic74

1:27 pm on Feb 27, 2009 (gmt 0)

10+ Year Member



hi, friends, i need some changes on one site and i need change the url to this kind of redirection:

http://example.com/music/80s-Hits/ to http://example.com/80s-Hits/

or

http://example.com/banda/x-men-80 a http://example.com/x-men-80

It can to work?:
RedirectPermanent http://example.com/genero/80s-Hits/ http://example.com/80s-Hits/

also, the person ask me about the 301 redirection so i was thinking maybe use all in one, i would like create some lines where i can redirect all the music types (80',70',etc) and music bands, maybe with some *? (im not very good with regular expressions)

thanks in advance if someone can help me, thanks!
tic

[edited by: jdMorgan at 4:22 pm (utc) on Feb. 27, 2009]
[edit reason] example.com [/edit]

g1smd

7:41 pm on Feb 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use RewriteRule with [R=301,L] instead of Redirectmatch.

RedirectRule ^[^/]+/([^/]+)/$ http://www.example.com/$1/ [R=301,L]

OR

RedirectRule ^[^/]+/([^/]+)$ http://www.example.com/$1 [R=301,L]

You need to decide if your canonical URL should end with a trailing slash or not. Without is likely best. Your examples were inconsistent: one with, one without.

Maybe this?

RedirectRule ^[^/]+/([^/]+)[b]/?[/b]$ http://www.example.com/[b]$1 [R[/b]=301,L]

tic74

11:30 pm on Feb 27, 2009 (gmt 0)

10+ Year Member



Thanks g1smd! and sorry for the inconsistent thing, really i'm a beginner on these settings and surely i will need improve my skills. I wil try it that you told me , can i mess out the site updating the htaccess or i can test without problem?
Thanks again!

g1smd

12:11 am on Feb 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can kill a site dead with a typo, even when pages seem to be working.

So, use Live HTTP Headers for Firefox to check the correct HTTP Response Code is returned each time, and check everything.

If possible use a password-protected test site, perhaps on a sub-domain, for testing.