troubleshooting Question

How do I redirect a misspelled URL to the correct one?

Avatar of theicemonkey
theicemonkey asked on
HTTP Protocol
2 Comments1 Solution1447 ViewsLast Modified:
I have two domains, one with hosting and one without. The domain without hosting is just a misspelling of the real one. Currently, I have a domain pointer set up so that if you put in the wrong URL it works anyway. My problem with this is that the bad URL remains in the address bar, and in fact Google has indexed the misspelling instead of the real URL.

I tried using the code below (without the dummy URL, obviously), but I get an infinite loop. Any suggestions using javascript or .htaccess? I've had no luck so far...
<script type="text/javascript">
    // alert(window.location);
    if(window.location == "") {
        window.location = "";
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros