Forum Moderators: phranque

Message Too Old, No Replies

.htaccess on partially working

         

batface

6:09 am on Jun 24, 2011 (gmt 0)

10+ Year Member



Hi,

I really hope someone can help me with a .htaccess problem, or point me in the right direction.

I'm trying to set 301 redirects on a URL similar to:

[somesite.com...]

I need to 301 redirect .../updates/latest-news/... to /news/article/... and drop the -me suffix

So if I create the rule:

RewriteRule ^(.*)(-me.*)$ $1 [R=301,L]

the URL is the same and the trailing -me is cleaned up. I'm happy that rewrite works, the regex works, and I comment this out.

However, neither of the following will work and I am confused:
RewriteRule ^(.*)/updates/latest-news/(.*)(-me.*)$ $1/news/article/$2 [R=301,L]
or
RewriteRule ^http://www.somesite.com/updates/latest-news/48927-doc-resource-admission-notice-me10$ [somesite.com...] [R=301,L]

This is on a Joomla site.

Could some kind soul please help and point me the right way?

thanks
Mick

g1smd

1:24 am on Jul 3, 2011 (gmt 0)

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



"Either way" sounds like a recipe for disaster: [site:www.example.com] and [site:example.com -inurl:www] will likely show the problem.

GWT has a "preferred domain" setting, but that doesn't help your listings in other searchengines, nor does it stop the proliferation of new links to the "wrong" URL as more and more people cut and paste incorrect URLs from their browser address bar.
This 31 message thread spans 2 pages: 31