0

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!

Zach Smith
  • 5,490
  • 26
  • 84
  • 139
  • 3
    Can you show the misspelled and the intended URL? – Pekka Sep 09 '10 at 19:33
  • it would be domain.com/whatever and I need to redirect that to domain.com/Whatever. The names aren't important as the plugin I'm using does the same thing for us, I just need to know how to manually do it – Zach Smith Sep 09 '10 at 19:35
  • 1
    Maybe you can mod_rewrite it in .htaccess? – gen_Eric Sep 09 '10 at 19:35

4 Answers4

5

In .htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^MisspelledURL$ CorrectURL [R=301,L]
gen_Eric
  • 223,194
  • 41
  • 299
  • 337
2

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
  • 369,085
  • 72
  • 557
  • 602
  • would this have to be on the actual page? Problem is I'm using Wordpress which creates pages dynamically. – Zach Smith Sep 09 '10 at 19:59
  • 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 Sep 09 '10 at 20:12
2

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
  • 356,200
  • 43
  • 426
  • 500
-2

You could forget all of this and just do a Domain forward in DNS. If you have control of the current domain modify the DNS Zone. BadDomain.com 14400 IN CNAME GoodDomain.com.

Adding scripts and php or htAccess all mean you have to be hosting the bad domain first. You can get a hold of your DNS Record for the good record and add the redirect & your done.

Chris-W
  • 1
  • 1