Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2012, 03:39 PM   PM User | #1
Psionicsin
Regular Coder

 
Psionicsin's Avatar
 
Join Date: Aug 2010
Location: Ann Arbor, Michigan
Posts: 334
Thanks: 51
Thanked 0 Times in 0 Posts
Psionicsin is an unknown quantity at this point
How to achieve this type of redirect?

Not sure what kind of redirect this is called, but I was on Pixar's website and decided to see if any other Pixar domains names were taken (don't ask me why).

Regardless of what I entered (pixar.net, pixar.org, pixar.co.uk, pixar.co, etc), the page, without even refreshing, just toook me right to pixar.com. There was no blank page first telling me that I was being redirected. There was no website within a frame, and best of all...the URL I enetered (ie pixar.net) is immediately replaced with pixar.com.

Is this just achieved through the .htaccess? If so, what's the correct method/name of this type of redirect?

I'm trying to redirect my example.net and example.org to my example.com site. All of their DNS names are pointed to my hosting server, and the domains are entered in my hosts domain manager.

Last edited by Psionicsin; 09-05-2012 at 03:46 PM..
Psionicsin is offline   Reply With Quote
Old 09-05-2012, 03:50 PM   PM User | #2
Psionicsin
Regular Coder

 
Psionicsin's Avatar
 
Join Date: Aug 2010
Location: Ann Arbor, Michigan
Posts: 334
Thanks: 51
Thanked 0 Times in 0 Posts
Psionicsin is an unknown quantity at this point
Or do I even need to do this since they're parked domains that are all pointing to my "Home Directory" anyway?

When I do the *.org address however, it redirects to *.com...but the address still says *.org.

Last edited by Psionicsin; 09-05-2012 at 04:02 PM..
Psionicsin is offline   Reply With Quote
Old 09-05-2012, 04:06 PM   PM User | #3
Psionicsin
Regular Coder

 
Psionicsin's Avatar
 
Join Date: Aug 2010
Location: Ann Arbor, Michigan
Posts: 334
Thanks: 51
Thanked 0 Times in 0 Posts
Psionicsin is an unknown quantity at this point
With...

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^cleartouchvisuals.net$ [OR]
RewriteCond %{HTTP_HOST} ^cleartouchvisuals.org$
RewriteRule ^(.*)$ http://www.cleartouchvisuals.com/$1 [R=301]
I'm getting this error when I visit my regular *.com: Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
Psionicsin is offline   Reply With Quote
Old 09-05-2012, 04:10 PM   PM User | #4
Psionicsin
Regular Coder

 
Psionicsin's Avatar
 
Join Date: Aug 2010
Location: Ann Arbor, Michigan
Posts: 334
Thanks: 51
Thanked 0 Times in 0 Posts
Psionicsin is an unknown quantity at this point
Ok I've gotten a bit further. I'm using this in my htaccess now:

Code:
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?cleartouchvisuals\.net
RewriteRule (.*) http://www.cleartouchvisuals.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?cleartouchvisuals\.org
RewriteRule (.*) http://www.cleartouchvisuals.com/$1 [R=301,L]
Seems to be doing what I need, and not causing any redirect loops with my regular *.com, however the *.org and *.net still aren't rewritten.
Psionicsin is offline   Reply With Quote
Old 09-05-2012, 04:19 PM   PM User | #5
Psionicsin
Regular Coder

 
Psionicsin's Avatar
 
Join Date: Aug 2010
Location: Ann Arbor, Michigan
Posts: 334
Thanks: 51
Thanked 0 Times in 0 Posts
Psionicsin is an unknown quantity at this point
Ok I got it using this instead:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} \.net$ [OR]
RewriteCond %{HTTP_HOST} \.org$ [OR]
RewriteCond %{HTTP_HOST} ^cleartouchvisuals.com$
RewriteRule ^(.*)$ http://www.cleartouchvisuals.com/$1 [R=301,L]
But is this the absolute correct way to do this without any consequences to SEO or anything else like that?
Psionicsin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:17 PM.


Advertisement
Log in to turn off these ads.