/ Published in: Bash
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
###### always access from www and redirect multiple doamins to one
rewriteCond %{http_host} ^domain\.com$ [OR]
rewriteCond %{http_host} ^domain\.org$ [OR]
rewriteCond %{http_host} ^www\.domain\.org$ [OR]
rewriteCond %{http_host} ^subdomain\.domain\.org$ [OR]
rewriteCond %{http_host} ^www\.subdomain\.domain\.org$ [NC]
rewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]
######always access from non-www and redirect multiple doamins to one
rewriteCond %{http_host} ^www\.domain\.com$ [NC]
rewriteRule ^(.*)$ http://domain.com/$1 [r=301,L]
Comments
 Subscribe to comments
                    Subscribe to comments
                
                