How to delete .htaccess from the server ?

Discussion in 'Site & Server Administration' started by polytron, Jun 2, 2008.

  1. #1
    No matter how many time I delete the .htaccess, it is still there. :confused:

    Does anyone know how I can get rid of this script permanently ? Thanks
     
    polytron, Jun 2, 2008 IP
  2. real_skinner

    real_skinner Notable Member

    Messages:
    2,400
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    215
    #2
    have you tried deleting it from FTP?

    What control Panel do you have?
     
    real_skinner, Jun 2, 2008 IP
  3. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Files starting with "." are recognized as hidden files in linux. In few latest CentOS and Redhat (4/5), they are not directly removable. To remove this file rename it to something like htaccess.old and then remove it. Otherwise, it will still recognize it as a hidden file and oppose you from deleting it.
     
    mellow-h, Jun 2, 2008 IP
  4. polytron

    polytron Member

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Mine is cPanel X. Yes I have deleted it from FTP but still show up on the server.

    Thank mellow-h, I followed your instruction but the file is still there.
     
    polytron, Jun 2, 2008 IP
  5. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If then change the permission to 777 after renaming it (Rename something like google.php) and void its content. Then delete it again. Let me know how does it go.
     
    mellow-h, Jun 2, 2008 IP
  6. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #6
    I upload a file as _htaccess then rename it to .htaccess and then delete it, because it doesn't show up to be able to be deleted.
     
    Nintendo, Jun 2, 2008 IP
  7. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #7
    another option is

    if you have SSH access to your site
    open .htaccess in vi
    like

    vi .htaccess

    then delete or better ###UNcomment the lines to disable all .htaccess content

    uncomment might be better option - there might be a later need for the file again. there is almost no site that runs without .htaccess unless you have all in your apache default config file.
     
    hans, Jun 3, 2008 IP
  8. xous

    xous Active Member

    Messages:
    173
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #8
    Hi,

    cPanel is likely recreating the file for you.

    Why do you want to remove the .htaccess file?
     
    xous, Jun 3, 2008 IP
  9. manish.chauhan

    manish.chauhan Well-Known Member

    Messages:
    1,682
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    110
    #9
    I'll be much better if you remove it from ftp...:)
     
    manish.chauhan, Jun 4, 2008 IP
  10. mrki

    mrki Active Member

    Messages:
    206
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #10
    If he goes trough ssh it's better to remove .htaccess like:
    rm -r .htaccess
    He don't need to edit it especially with vi, becouse he must be able to save
    changes after edit with vi and of course he must leave the vi editor, considering that he has trouble with deleting this file I think he isn't well with vi as well ;)
     
    mrki, Jun 4, 2008 IP
  11. ziplock122949

    ziplock122949 Active Member

    Messages:
    159
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #11
    Did the rename create a copy (ie .htaccess was still there along with the new name htaccess.old) or did it actually rename it? If it did rename it, i would say leave it as a renamed file for the moment so it is out of play. If it created a copy, I would start to think that maybe the host has some kind of restriction. I just switched a microsoft package to linux on 1and1 and they put a .htaccess file into the root. All it had was non www to www redirect.
     
    ziplock122949, Jun 4, 2008 IP