tags:

views:

54

answers:

3

So I have a stupid marketing team that gave 1 million people a URL to our site and it's misspelled. How do I take the incoming URL and redirect it to the correct URL? I'm using Wordpress site, and we're using a redirection plugin but it's causing a ton of problems so I want to find out how to manually do this if possible.

Any gurus would like to help would be appreciated!

+5  A: 

In .htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^MisspelledURL$ CorrectURL [R=301,L]
Rocket
You should add a 301 "Moved Permanently" status code though..
poke
@poke, I added that to the answer.
Rocket
Good, +1 then :)
poke
so it would be RewriteRule ^http://domain.com/bad$ http://domain.com/Bad [R=301,L] - with Bad being the actual page that i am trying to redirect TO?
HollerTrain
Yes, but if pages are on the same domain, you can just do `RewriteRule ^bad$ /Bad [R=301,L]`. domain.com/bad will redirect to domain.com/Bad
Rocket
+2  A: 

If you don't have access to mod_rewrite (Rocket's answer), you could also send the header by simply adding a script that does so to the misspelled directory. For example with php:

<?php
header( 'HTTP/1.1 301 Moved Permanently' );
header( 'Location: http://domain.com/Whatever' );
exit;
?>
poke
would this have to be on the actual page? Problem is I'm using Wordpress which creates pages dynamically.
HollerTrain
You simply add a file to the misnamed directory that is called automatically (usually index.php). I'm not sure if that works with Wordpress, as that usually already uses mod_rewrite to rewrite every single url..
poke
+2  A: 

If it's a simple URL and you don't need to fix up query parameters, you could use a simple

RedirectPermanent /bad/URL/here http://example.com/proper/url/here

in your httpd.conf. That'll send a 301 code as well

Marc B