Results 1 to 6 of 6

Thread: Redirecting 2nd URL ?

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Posts
    774

    Redirecting 2nd URL ?

    I have two domain names one is plural and the other is singular im trying to redirect the typin for the singular to redirect to the plural domain name? whats the best method for this ? there was a answer to this but i cant seem to find it using search..

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Set up your hosting so that both domains point to the same location, then put this in your .htaccess:

    RewriteCond %{HTTP_HOST} ^online-literature.com [NC]
    RewriteRule ^(.*)$ http://www.online-literature.com/$1 [L,R=301]
    RewriteCond %{HTTP_HOST} ^www.theliteraturenetwork.com [NC]
    RewriteRule ^(.*)$ http://www.online-literature.com/$1 [L,R=301]
    RewriteCond %{HTTP_HOST} ^www.literature-web.net [NC]
    RewriteRule ^(.*)$ http://www.online-literature.com/$1 [L,R=301]
    RewriteCond %{HTTP_HOST} ^www.theliteraturenetwork.com [NC]
    RewriteRule ^(.*)$ http://www.online-literature.com/$1 [L,R=301]
    Or rather, that is the one I use for my literature site, which redirects my 3 domains for that site and the non-www versions of said domains to the main domain.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Senior Member
    Join Date
    Jul 2003
    Posts
    774
    Thanks Chris!!!

  4. #4
    Senior Member
    Join Date
    Jul 2003
    Posts
    774
    1. Would this be it "Domain Forwarding redirects or "points" your domain to another location. "

    It gives me 2 options 301 or 302 im assuming 301... but just want to clarify.

  5. #5
    Registered
    Join Date
    Aug 2006
    Location
    Sacramento, CA
    Posts
    208
    Yes, a 301 is a permanent redirect and 302 is temporary, so for this you would want to use a 301.
    ________
    ASIAN HARDCORE
    Last edited by rpanella; 03-17-2011 at 10:34 AM.

  6. #6
    Registered
    Join Date
    Aug 2006
    Location
    Sacramento, CA
    Posts
    208
    Chris, from the htaccess that you posted, it doesn't look like you are actually redirecting the non-www versions of the other names as well. (I just tried http://theliteraturenetwork.com and sure enough it didn't redirect.

    You could replace all those lines with this:

    Code:
    RewriteCond %{HTTP_HOST} !^www\.online-literature\.com [NC] 
    RewriteRule ^(.*)$ http://www.online-literature.com/$1 [L,R=301]
    This will take care of all the cases yours currently does as well as the non-www versions that it currently doesn't. The "!" is a negative operator so its bascially saying if the host is not www.online-literature.com then redirect it to that, which is more efficient than checking each other case.
    ________
    BONDAGE HARDCORE
    Last edited by rpanella; 03-17-2011 at 10:34 AM.

Similar Threads

  1. Redirecting
    By izwar in forum Search Engine Optimization
    Replies: 0
    Last Post: 02-11-2007, 11:31 PM
  2. Redirecting CJ affiliate links
    By ozgression in forum Advertising & Affiliate Programs
    Replies: 7
    Last Post: 11-13-2004, 02:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •