Forum Moderators: phranque
I have access to my .htaccess and I'm on Linux based servers.
It's crucial that the solution is compatible with Google, Yahoo and MSN.
This has been driving me absolutely mad over the last few weeks and I can't seem to be able to solve it. The webmaster of the other site is uncontactable and I can see the errors in my logs and going by the amount, it's something that I really need to get done as quickly as possible.
Any help very much appreciated.
Sev.
See our forum charter [webmasterworld.com] for some references.
Jim
I'm getting a little confused, I have this in my .htaccess (which isn't working):
RewriteRule ^firstword%20secondword/?$ [example.com...] [R=301,L]
The incorrect link on the other site is, for example:
[example.com...] secondword/
Are you saying that I should replace the %20 with one of the characters below please?
^([^\ ]+)\ (.+$)
Any help very much appreciated.
Sev.
> Are you saying that I should replace the %20 with one of the characters below please?
^([^\ ]+)\ (.+)$
One of the powerful features of mod_rewrite is that it includes regular-expressions pattern-matching. You can write one RewriteRule that will remove a space from *any* URL requested from your server. In this case the pattern above says, "Match one or more of any characters, except for a space, and save those characters in a variable. Then match a literal space (this is written as "\ "). Then match one or more of any additional chararacters, and save those in a second variable. You use it like this:
RewriteRule ^([^\ ]+)\ (.+)$ http://www.example.com/$1$2 [R=301,L]
If you only need to fix one URL, then a specific solution would be:
RewriteRule ^firstword\ secondword/?$ http://www.example.com/firstwordsecondword/ [R=301,L]
Jim