Results 1 to 2 of 2

Thread: 301 .htaccess rewrite rules

  1. #1
    Join Date
    Apr 2009
    Location
    The toon
    Posts
    1,225

    301 .htaccess rewrite rules

    I am after a 301 redirect and have my .htaccess directive set as follows

    Code:
    RewriteCond %{HTTP_HOST} ^(www\.)?domain\.co.uk [NC] 
    RewriteCond %{QUERY_STRING} ^(.*)$ 
    RewriteRule ^(.*)$ http://www.domain.com/$1?%1 [R=301]
    notice its catching all .co.uk requests and redirecting to .com (appending any querystring to the new domain of course)

    So the question is can i do this when dealing with multiple 301's pointing and resolving to one marketed domain or do i have to have a Rewrite Rule in for each directive...

    Code:
      #RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com [NC]
      #RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.co.uk [NC]
      #RewriteCond %{HTTP_HOST} ^(www\.)?domain3\.co.uk [NC]
      #RewriteCond %{QUERY_STRING} ^(.*)$
      #RewriteRule ^(.*)$ http://www.eaga.com/$1?%1 [R=301]

  2. #2
    Join Date
    Sep 2009
    Posts
    81

Similar Threads

  1. 301 Redirect Question
    By robertuva in forum General Questions
    Replies: 0
    Last Post: 16 Oct 2008, 10:32 AM
  2. I need some help with this rewrite rule
    By darthmalis in forum Search Engine Optimization and Marketing
    Replies: 0
    Last Post: 15 Jul 2007, 03:53 AM
  3. Redirecting my website 301 in HTML?
    By wtfmancmon in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 24 Feb 2007, 11:50 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
  •