Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Location
    USA
    Posts
    814

    Mod Rewrite (Redirect All domains if it does not match)

    Hey all,

    I have a friend who has like 250 domains going to this one site. Right now if you go to each doain, they are just added as a alias and loas the page. He wants to do a 301 redirect where if the domain they are coming from is now www.HISPRIMARYDOMAIN.com then to redirect them there.


    Obiosly doing HTACCESS redirects would be brutal for 500 diffrent redirects.

  2. #2
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    That's a standard one:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www.hisprimarydomain.com$ [NC]
    RewriteRule (.*) http://www.hisprimarydomain.com/$1 [R=301,L]
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Similar Threads

  1. Yet another URL redirect / mod rewrite question
    By Acroplex in forum Programming Discussion
    Replies: 3
    Last Post: 10-09-2006, 05:50 PM
  2. rewrite and ssl redirect
    By lachtan in forum Hosting Security and Technology
    Replies: 1
    Last Post: 03-02-2005, 03:45 PM
  3. .htaccess redirect/rewrite question
    By croakingtoad in forum Programming Discussion
    Replies: 1
    Last Post: 09-22-2004, 05:10 PM
  4. redirect or rewrite?
    By parabola in forum Hosting Security and Technology
    Replies: 3
    Last Post: 07-30-2003, 02:16 PM
  5. Redirect or Rewrite
    By ellebi in forum Dedicated Server
    Replies: 1
    Last Post: 03-15-2003, 02:44 AM

Posting Permissions

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