Redirecting Only Root But Not Subfolders

Discussion in 'Apache' started by secretdesign, Feb 5, 2013.

  1. #1
    Hi,

    I have small problem and I'm not expert in htaccess

    For now I have this


    RewriteEngine On
    RewriteCond %{http_host} 7eh\.net|www\.7eh\.net
    RewriteRule ^/?$ http://www.secretdesignart.com/ [L]


    But some folders are redirected.
    You can check here:

    http://7eh.net/akcija_wp/
    http://7eh.net/footarcade/
    http://7eh.net/hiphopvids_wp/
    http://7eh.net/imdb/
    http://7eh.net/bimsport/
    http://7eh.net/klm/
    http://7eh.net/lrm/
    http://7eh.net/minibusbox/
    http://7eh.net/movie_theme/
    http://7eh.net/onlypaintgames/
    http://7eh.net/ps4db/
    http://7eh.net/ptcd/
    http://7eh.net/scaryhub/

    Any tips?

    THX in advance.
     
    secretdesign, Feb 5, 2013 IP
  2. ryan_uk

    ryan_uk Illustrious Member

    Messages:
    3,983
    Likes Received:
    1,022
    Best Answers:
    33
    Trophy Points:
    465
    #2
    Something like:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} example\.com$ [NC]
    RewriteRule ^/?$ http://example2.com/ [L,R=301]
    Code (markup):
    I haven't tested it, so I can't say for sure (I'm at work), but I'm 99% sure it will work.
     
    ryan_uk, Feb 8, 2013 IP
  3. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Can you pastebin your apache configuration files inside /etc/apache2/ or /etc/httpd/, or wherever on your box they are. Also, can you pastebin the entire htaccess file? It sounds like an apache directive, or something else inside the htaccess file.
     
    cesurasean, Feb 19, 2013 IP