0

My htaccess file is gone after uploading.

I see it there for a minute or then it's gone. Even cPanel File Manager shows the same thing.

Any idea how to fix it? The web host says the problem is on my end.

  • It's simply hidden in your cpanel. If you access web server with FileZilla, do you see it? – lucgenti Jun 8 '15 at 8:11
  • 2
    I liked the original title of 'htaccess file goes poof after uploading' :D Even the edit was poor and the grammar hasn't been corrected. – zigojacko Jun 8 '15 at 8:50
  • 1
    I'm not native english so I let other people correct grammar. "goes poof" is slang. – lucgenti Jun 8 '15 at 8:57
  • If you are using cPanel File Manager then your "web host" should be able to help you, as this is "their end". Which FTP client are you using? Note that FileZilla also has the option to "hide dot files" (files that start with a dot eg. ".htaccess"). – MrWhite Jun 8 '15 at 9:26
  • If you can shell in I suggest doing that to know for sure. You can issue a ls -al to see all files including hidden files in list form. Any file with a leading dot (.) is a hidden file. If the file is there, you should see it okay. – closetnoc Jun 8 '15 at 15:08
1

On the end of the URL when in the file manager, add &showhidden=1. This will show you hidden "dotfiles" (Files beginning with a .)

Like so:

https://example.com:2083/cpsess1234567890/frontend/x3/filemanager/index.html?dir=/public_html&showhidden=1

1

Even cPanel File Manager shows the same thing.

In the popup dialog that opens before getting to the file manager itself you need to make sure that "Show Hidden Files (dotfiles)" is checked.

cPanel File Manager Directory Selection

Unfortunately, if you've previously checked "Skip this question" or you simply don't get this option then a similar option does not seem to be available in the file manager itself. In this case it seems you will need to manually edit the URL as @PeterBishop suggests. Although you can still "search" for .htaccess and see it listed in the search results you still can't edit it.

0

Login to cPanel and use its File Manager to observe the directory contents. I am uncertain that your .htaccess file is still there. Many FTP clients need you to tie a setting to show all documents, otherwise they hide things like .htaccess. I think that may be what's in with your FTP client software.

Some hosts have the server set up to not display the .htaccess file for safety details. You can still upload it and it will work, but you can’t download it or view it. Perhaps you could test the existence of the file by putting something in it that would be noticeable if it was working - like a password. If the changes are taking affect then the file is truly present - just not on display via ftp.

  • It's there and has been live since 10am and everything is working as it should. But when I upload a new one it might go MIA like it did last night. I just had to give-up & catch some zzz's. – user49378 Jun 8 '15 at 18:14
0

In my experience the File Manager in cPanel usually fails to show weather .htaccess and similar files are currently on the FTP partition so I wouldn't rely on it. Instead connect using something like FileZilla and see if it's there.

If the file is actually being deleted, then my first though would be to check if there are any scripts running on the server that deal with .htaccess files, for instance a wordpress plug-in that promises SEO boosts by tweaking the site etc...

  • Attracta.com says it's not them. I never did sign up w/ them just poked around in cPanel. I know the .htaccess file is being deleted due to svg/svgz files don't display and all the bad bots are not blocked. I have been trying to test the HTML5 Boilerplate .htaccess file from there. It has some bugs with my shared host... The site is HTML5 w/ PHP Shell - I'm NOT a CMS fan. – user49378 Jun 8 '15 at 18:00
  • Everything is working as it should now; maybe it was on my end? – user49378 Jun 9 '15 at 2:15
0

In cpanel, make sure that hidden files are visible. If using ssh, you can cd to your directory. Then do ls -a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy