Problems Redirecting Homepage in .htaccess

Discussion in 'Apache' started by jukebox9988, Sep 15, 2007.

  1. #1
    As an exit strategy, I dissolved an older blog so I could pass all the links to a newly written resource article on my home domain.

    I successfully redirect ALL the subpages to my article on a different domain, all except the homepage itself.

    Everytime I enter:

    Redirect 301 / http://www.mysite.com
    Code (markup):
    All the 301 subpage redirects get broken. How do I 301 redirect all the subpages AND the top level domain too?

    Thanks guys!
     
    jukebox9988, Sep 15, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    RedirectMatch .* http://www.mysite.com
    Or you can use mod_rewrite to carry over the request info, e.g.:

    oldsite.com/some-random-page to newsite.com/some-random-page
     
    krt, Sep 15, 2007 IP
  3. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cyanide, Sep 17, 2007 IP
  4. jukebox9988

    jukebox9988 Well-Known Member

    Messages:
    607
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Thanks everyone.

    Here's what worked perfectly:

    Redirect 301 /index.php http://www.mysite.com
    Code (markup):
    It was a WP blog, so I forget the rewrite condition was on.
     
    jukebox9988, Sep 17, 2007 IP
  5. alizilla

    alizilla Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What a good post .. can we expand this alittle further ..

    I am crawling the web for this.

    using rewrite can we :

    Redirect all visitors looking for a *.php file to a new domiain ?
    But then , have them redirect to the same name file on the new domain

    example
    www.domain.com/index3.php?some_string
    redirect to
    www.newdomian.com/index.php?some_string

    Easy so far ... But
    There are already .html files in www.domian.com :D , now i'm stuck Help ?

    thanks in advance .
    ali
     
    alizilla, Oct 2, 2007 IP