htaccess, remove text from url

Posted by Keiron Lowe on Stack Overflow See other posts from Stack Overflow or by Keiron Lowe
Published on 2010-06-11T10:22:54Z Indexed on 2010/06/11 10:43 UTC
Read the original article Hit count: 282

Filed under:
|

Here is the email from the client explaining what he is trying to do, we have spent hours trying to sort out this problem but cannot find a solution that works.

I am trying to correct a problem with my blog and google “not found” URLs.

I thought it might be very simple to correct (!ha!)

This is my line of code;

RewriteCond %{THE_REQUEST} ^www.uk-domestic-cleaning.com/wpblog/tag/?(.*)/HomeMaid%20Domestic%20Cleaning$
RewriteRule ^wpblog\/tag\/?(.*)\/HomeMaid%20Domestic%20Cleaning$ "http\:\/\/www\.uk\-domestic\-cleaning\.com\/wpblog\/tag\/$1" [R=301,L]


What I am trying to do is any request to */wplog/tag/ “anything here”/HomeMaid Domestic Cleaning To strip the “HomeMaid Domestic Cleaning” bit off the end, but leave the rest of the request intact, which will then be a valid request.

Any idea's guys?

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about urls