simple htacess help please

Discussion in 'Apache' started by unlisted80, Sep 13, 2006.

  1. #1
    unlisted80, Sep 13, 2006 IP
  2. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Is the domain yours?

    If so, please post back what is currently in your .htaccess file to see what is the next step to get rid of the folder name.
     
    Pat Gael, Sep 13, 2006 IP
  3. unlisted80

    unlisted80 Peon

    Messages:
    644
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this is in my main root directory

     
    unlisted80, Sep 13, 2006 IP
  4. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Remove the above code and try this out:

    
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mydomain.com/STUPIDFOLDER $ [OR]
    RewriteCond %{HTTP_HOST} ^www.mydomain.com/STUPIDFOLDER $
    RewriteRule ^(.*)$ www.mydomain.com [R=301,L]
    
    Code (markup):
     
    Pat Gael, Sep 13, 2006 IP
  5. BigPapi

    BigPapi Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    good advice basedsolutions, i think that should work
     
    BigPapi, Sep 13, 2006 IP
  6. unlisted80

    unlisted80 Peon

    Messages:
    644
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    unlisted80, Sep 13, 2006 IP
  7. Pat Gael

    Pat Gael Banned

    Messages:
    1,331
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, it should work fine.

    However Unlisted80, if you want to make sure your redirection goes to index.php, do it this way:


    
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^mydomain.com/STUPIDFOLDER $ [OR]
    RewriteCond %{HTTP_HOST} ^www.mydomain.com/STUPIDFOLDER $
    RewriteRule ^(.*)$ http://www.mydomain.com/index.php [R=301,L]
    
    
    Code (markup):
     
    Pat Gael, Sep 13, 2006 IP