http 301 redirect from htaccess to domain host
        Posted  
        
            by neilc
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by neilc
        
        
        
        Published on 2010-03-22T15:48:42Z
        Indexed on 
            2010/03/22
            15:51 UTC
        
        
        Read the original article
        Hit count: 365
        
Hi
I have the following in a .htaccess file
redirect 301 /page.php http://domain.com/page
Which works fine and as expected.
I want to be able to redirect the following
http://domain2.com/page.php to http://domain2.com/page
or
http://domain3.com/page.php to http://domain3.com/page
or
http://domain4.com/page.php to http://domain4.com/page
So basically whatever the domain name is, I want to redirect to it. But the catch is I want to use a 301 redirect. Is this even possible ? Or should I be using RewriteCond and RewriteRule ?
© Stack Overflow or respective owner