【问题标题】:How to upload .htaccess file using ftp如何使用 ftp 上传 .htaccess 文件
【发布时间】:2011-11-10 11:19:22
【问题描述】:

我试图在服务器上上传 .htaccess 文件,ftp 给了我“严重文件传输错误” 然后我将它重命名为“htacces”然后我上传了,之后我无法将它重命名为“.htaccess”,它给了我“550 denied on server. your limited to your account ftp”错误。那么该怎么做呢。

【问题讨论】:

    标签: php .htaccess ftp


    【解决方案1】:

    您应该就此事联系您的托管服务提供商。您的 FTP 帐户 maybe 仅限于某些操作。

    【讨论】:

      【解决方案2】:

      尝试使用代码上传 php-script createhtaccess.php

      file_put_contents('.htaccess', 'Deny from all'."\n".'Allow from all');
      

      然后从网络上运行他

      甚至上传带有 .htaccess 内容的this-is-not-htaccess.txt, 然后上传php脚本:

      file_put_contents('.htaccess', file_get_contents('this-is-not-htaccess.txt'));
      

      【讨论】:

      • 你能上传任何 *.txt 文件到 ftp 并从 web 访问他的文件吗?
      • 我没听懂。你的意思是我可以上传 .txt 文件吗,是的,我可以。
      猜你喜欢
      • 2014-09-11
      • 2020-07-12
      • 2012-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-31
      相关资源
      最近更新 更多