.htaccess code for redirecting any links/url to domain

Discussion in 'Apache' started by slaxy, Jul 14, 2010.

  1. #1
    hi all,

    i have a subdomain lets say, http://subdomain.domain.com, which is basically a image showing some error message,

    i want to have a .htaccess which can make any url/link like

    http://subdomain.domain.com/somelink.html
    http://subdomain.domain.com/xyz/abc/whatever/

    to redirect back to

    http://subdomain.domain.com/


    -slax
     
    slaxy, Jul 14, 2010 IP
  2. nimonogi

    nimonogi Active Member

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #2
    You need something like that:
    
    RedirectMatch 301 ^subdomain/$ http://subdomain.domain.com/
    
    Code (markup):
     
    nimonogi, Jul 17, 2010 IP
  3. slaxy

    slaxy Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    Hi nimonogi,

    using the command i am getting

    500 Internal Server Error

    - slax
     
    slaxy, Jul 26, 2010 IP
  4. bhavatmaj

    bhavatmaj Well-Known Member

    Messages:
    319
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #4
    bhavatmaj, Jul 28, 2010 IP