Redirect www.domain.com/app?et= to www.domain.com/

Discussion in 'Apache' started by ebinx, Feb 1, 2010.

  1. #1
    How to, using mode_rewrite in .htaccess
    redirect this:
    www.domain.com/app?et=
    to the default index file in the main root folder:
    www.domain.com
     
    ebinx, Feb 1, 2010 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    something like below should do your job:

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^app?et=$ / [L,R=301]
     
    hans, Feb 3, 2010 IP
  3. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    413
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #3
    Hello,

    Are you using cPanel if yes then go for redirect option.
     
    hostechsupport, Feb 3, 2010 IP
  4. ebinx

    ebinx Peon

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This does not work for me:
    RewriteRule ^app?et=$ / [L,R=301]

    I tried with:
    RewriteRule ^app$ / [L,R=301]
    and i works to some extend it gives the index page- GOOD, but with query string at the end:
    http://www.domain.com/?et=

    when I added ? after /

    RewriteRule ^app$ /? [L,R=301]

    works like a charm.

    Just for the reference I also tried this but it did not work:
    RewriteCond %{REQUEST_URI} ^/app$
    RewriteCond %{QUERY_STRING} ^\?et=
    RewriteRule (.*) http://www.domain.com/$ [R=301,L]
     
    ebinx, Feb 3, 2010 IP