![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Jun 2011
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi Friends I'm working for my client site and i done 301 redirect from .com to .in and it's working but when i put the url without www it's not working so i need satisfy two conditions, how should i do. |
| | |
| | |
| | #2 |
| Susan - Research Nut War Room Member Join Date: Sep 2008 Location: Vancouver, WA
Posts: 130
Thanks: 15
Thanked 55 Times in 36 Posts
|
I'm not sure I 100% know what you are asking, but here's what I think you're asking. You have a domain named mydomain[dot]com. You want it to go to mydomain[dot]in You set up a redirect that takes the non-www version from .com to .in Are you using htaccess or some other thing like a php redirect? If htaccess, which works best for this for me, then you actually have to do a couple of rewrite conditions. Since each version of a domain www[dot]mydomain[dot]com and mydomain[dot]com are seen by Google and others as TWO DIFFERENT urls, a case coming in for www. is a different page to handle than one for (non-www) mydomain[dot]com. Assuming you want to use the non-www version in "real life use" you want to redirect all three of the others. The cleanest is to clean up the .com and then the .in So I'd first set up a rewrite condition from the www[dot]mydomain[dot]com to mydomain[dot]com with a 301. Do the rewrite rule to do it. Now all www[dot]mydomain[dot]com goes to mydomain[dot]com Next, redirect mydomain[dot]com to mydomain[dot]in (condition and rule) Now everything .com heads to mydomain[dot]in Lastly, catch anything incoming to the www[dot]mydomain[dot]in by doing one more condition rewrite from www[dot]mydomain[dot]in to mydomain[dot]in That should cover it. I don't do enough htaccess to know if you can do all conditions and then one rule to redirect, or not. I suspect the safest way would be to do condition, rule, condition, rule. And most importantly, do one step. Test the redirecting and redirected domains. Next one, test again, last one test again. All done, test them all. That way you catch one if it is broken before you monkey with the others. Now, if I had the question wrong altogether, I apologize. Some additional info would help to try to answer better. Oh, and other server-side folks here can probably give you better htaccess instructions than I could, but basically that's the way you do a single 301 domain redirect so I'm thinking it should work for more if you go step by step. Oh, and Hey Everyone, if I'm giving bad instructions, PLEASE shout out! I don't want to screw goodluckdomain up. Or teach myself bad habits. |
| Always Interested in Hearing About Cool SEO Tools and Useful WP Plugins via threads or PMs. Interested in Social Media Tools and Content for The Local Marketing Expert clients. Last edited by esdavis; 07-01-2011 at 06:01 AM. Reason: Rewrote domain names to avoid forum "adjusting" | |
| | |
| | #3 |
| Myth Fighter Join Date: Jun 2011 Location: Philippines
Posts: 105
Thanks: 0
Thanked 9 Times in 8 Posts
|
If that's the case, you also have to redirect the URL without www so that it will also work as well.
|
| | |
| | #4 |
| Susan - Research Nut War Room Member Join Date: Sep 2008 Location: Vancouver, WA
Posts: 130
Thanks: 15
Thanked 55 Times in 36 Posts
|
That's what I'm saying. You've got 3 to redirect all eventually to the 4th one. The cleanest way is a chain, so if you ever undid the part heading to mydomain[dot]in, your www to non-www mydomain[dot]com would still be in place. Anyway so: 1. www. for .com goes to non-www for .com (stop here is standard .com redirection) 2. non-www for .com goes to non-www for .in Now both .com domains end up at non-www .in 3. www for .in goes to non-www for .in Now it also hits non-www .in You don't to redirect the traffic coming into mydomain[dot]in because that's where you want all links with those 4 incoming URLs to end up. 3 are redirected and the final one stays open and clear for traffic. I hope I haven't confused anyone and this update made things a little clearly. And really, if it makes you nervous or scares you, I'm sure you can get somebody on Fivrr to write you up a sample template type HTACCESS file with simple instructions on how to upload it and use it, as well as what lines to modify and when. |
| Always Interested in Hearing About Cool SEO Tools and Useful WP Plugins via threads or PMs. Interested in Social Media Tools and Content for The Local Marketing Expert clients. | |
| | |
| | #5 |
| Active Warrior Join Date: Jun 2011
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hi Davis thanks for your reply its working for me.
|
| | |
| | |
| | #6 |
| Susan - Research Nut War Room Member Join Date: Sep 2008 Location: Vancouver, WA
Posts: 130
Thanks: 15
Thanked 55 Times in 36 Posts
|
Glad it's working. Sometimes htaccess really is helpful.
|
| Always Interested in Hearing About Cool SEO Tools and Useful WP Plugins via threads or PMs. Interested in Social Media Tools and Content for The Local Marketing Expert clients. | |
| | |
![]() |
|
| Tags |
| 301, conditions, multiple, redirect |
| Thread Tools | |
| |
![]() |