301 redirection problem

Discussion in 'Programming' started by Toon-c, Jun 11, 2009.

  1. #1
    Hi Dp ..
    I did a 301 redirection to redirect mysiteexample.com pages to www.mysiteexample.com pages //

    here is the code .. in the .htaccess

    <Ifmodule mod_rewrite.c>
    Options +FollowSymlinks 
    RewriteEngine on 
    RewriteBase / 
    
    
     
    ### re-direct index.php to root / ###
    RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
    RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
     
    
     
    ### re-direct IP address to www
    ### re-direct non-www to www
    ### re-direct any parked domain to www of main domain
    RewriteCond %{http_host} !^www.youtips.net$ [nc]
    RewriteRule ^(.*)$ http://www.youtips.net/$1 [r=301,nc,L] 
    ####
     
    
    </Ifmodule>
    PHP:
    It works fine , but subdomain , blog.mysiteexample.com is redirected to www.mysiteexample.com/blog ..

    Can anyone help me to fix this ?
    thanks
     
    Toon-c, Jun 11, 2009 IP
  2. manikas

    manikas Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Propably you will have to do the same in .htaccess which is in the directory of blog.mysiteexample.com .
     
    manikas, Jun 11, 2009 IP
  3. Toon-c

    Toon-c Well-Known Member

    Messages:
    1,775
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #3
    no, not working ..
    thanks for answering anyway ..
     
    Toon-c, Jun 11, 2009 IP
  4. zandrarogers

    zandrarogers Guest

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domainname.com
    RewriteRule (.*) http://www.domainname.com$1 [R=301,L]

    Save this in .htaccess format and upload it to your site, i hope it will work
     
    zandrarogers, Jun 14, 2009 IP
  5. Toon-c

    Toon-c Well-Known Member

    Messages:
    1,775
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    180
    #5
    thanks , I already solved the problem ..
     
    Toon-c, Jun 21, 2009 IP