htaccess specific 301 redirection

Discussion in 'Apache' started by Aleks5, Jul 14, 2014.

  1. #1
    Hi,

    i wonder if someone can help me. We have 5 domains on one server showing exactly same content.
    Right now, four of them (better said all of them but one, including or excluding www) have been redirected by 301 redirection. Here's how it looks like

    Rewritecond %{HTTP_HOST} !^www\.domanin1\.com
    RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]
    Code (markup):
    Now i've got a request to "un redirect" one of them.
    Example:
    
    if user types (www.)domain1.com or (www.)domain2.com - do nothing
    if user types (www.)domain3.com or (www.)domain4. com or (www.)domain5.com, redirect them to domain1.com
    
    Code (markup):
    Help is very much appreciated!
    Cheers,
    Aleks
     
    Aleks5, Jul 14, 2014 IP