Redirecting url's in Apache to a directory

Discussion in 'Apache' started by goforaman, Jan 26, 2010.

  1. #1
    Hi All,

    I am new to apache, trying to redirect the URL to an directory but unable to do this after a lot of googling also,

    my requirement is that when user hit to link

    http://you.yourdomain.com/

    it should be redirected to the http://you.yourdomain.com/abc_dir

    where my application resides.

    i am using the Apache/2.2.3 on CentOS 5.3, four applications running on this server, i want this for all my four applications which resides in /var/www/html/.. .

    Please help me out, any kind of help or clue will be really appreciated.

    regards,
    aman
     
    goforaman, Jan 26, 2010 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    this below should work ( it did when testing it on my server )
    enter in .htaccess at / level of your domain

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^$ /abc_dir [L,R=301]
     
    hans, Jan 26, 2010 IP