1

Whenever I create an .htaccess file in a directory it disappears. I am running a VPS at Digital Ocean (I have full control over the server). So I can't see why my .htaccess files are automatically deleted upon creation. I even tried to make the file on my computer and just transfer it to the directory via FTP but as soon as it transfers, it disappears. I checked the log of the FTP transfer and the file transferred successfully. I can't figure this out.

4

2 回答 2

4

这是因为系统文件隐藏在 apache 服务器上...如果您使用的是 GUI,请选择查看隐藏文件的选项,或者如果您在终端上输入命令“ls -a”,您应该会看到这些文件。默认情况下,任何以点开头的文件都将被隐藏。您的 .htaccess 文件属于同一类别。

于 2013-08-08T03:52:39.743 回答
0

如果您希望能够查看服务器上的 .htaccess 文件,请确保您以 root 用户或具有 root 级别权限的用户身份登录。

然后,导航到“/home/username/public_html(在我的情况下)”如果您上传了一个 .htaccess 文件,它应该显示在那里。

于 2014-02-25T05:11:17.603 回答