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!
In .htaccess:
RewriteEngine On
RewriteBase /
RewriteRule ^MisspelledURL$ CorrectURL [R=301,L]
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;
?>
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
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.
精彩评论