Forum Moderators: phranque

Message Too Old, No Replies

redirect to different domain on same IP

redirect using htaccess

         

Tapolyai

8:29 pm on Jun 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have:
example.com
example.org
example.net

The site is officially on example.com.

Unfortunatelly, Google still indexes example.org and example.net with the same content.

I would like to add a permanent redirect into my .htaccess which would redirect anyone when they use example.org or example.net to example.com.

How would I go about it?

thanks!

[edited by: Tapolyai at 8:30 pm (utc) on June 7, 2007]

RonPK

8:52 pm on Jun 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not trying to be rude, but have you had a look at the documentation?

Redirect directives: [httpd.apache.org...]

or, more complicated: mod_rewrite: [httpd.apache.org...]

jdMorgan

9:15 pm on Jun 7, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This search [google.com] may also come in handy. Several of the solutions presented in these threads will do all or most of what you need -- There's little difference between the .net/.org redirects and the www/non-www redirects, particularly if the negative-match form of the RewriteCond is used.

Jim

Tapolyai

2:17 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, I have looked, but thanks.

Thanks - one of those searches did reveal the right gem.

<grumble>wish he would put back the old search tool grrr...</grumble>

[edited by: Tapolyai at 2:18 pm (utc) on June 8, 2007]

rocknbil

8:10 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



He never took it away. Go to your control panel -> system preferences and paste this in "Custom Code Insert Top:"

<form method="GET" action="http://www.google.com/search" target="_blank"><input type="hidden" name="domains" value="webmasterworld.com"><input TYPE="text" name="q" size="25" maxlength="255" value><input type="submit" name="btnG" value="Google"><input type="radio" name="sitesearch" value="webmasterworld.com" checked> webmasterworld.com <input type="radio" name="sitesearch" value>www</form>

:-)

jdMorgan also helped out yesterday with a slight variation on the 301 redirect, it's not the "usual" way but it got around some problems for me:

[webmasterworld.com...]