由于服务器主机的 SSH 服务被关掉,只能被迫使用 FTP(File Transfer Protocol)来管理网站。这不刚好需要修改一个 .htaccess 文件,刚好它是隐藏属性的,使用 FileZilla FTP 工具也查看不了。殊不知 FileZilla 的“服务器”菜单项中有“强制显示隐藏文件”选项。

启动“强制显示隐藏文件”会有确认信息,需要使用的是 FTP 协议,同时需要服务器支持。

如果手头上没有 FTP 软件,可以使用 Windows 自带的 FTP 命令,在 CMD 命令行输入 ftp 即进入该模式:

C:>ftp ftp> open yourdomain.com Connected to yourdomain.com. 220 XXXHost FTP Server User (yourdomain.com:(none)): username 331 Password required for tb_cdl. Password: 230 User username logged in. ftp> cd yourdomain.com 250 CWD command successful ftp> get .htaccess 200 PORT command successful 150 Opening ASCII mode data connection for .htaccess (379 bytes) 226 Transfer complete. ftp: 收到 394 字节,用时 0.00Seconds 394000.00Kbytes/sec.

如果需要上传。htaccess 必须以 ASCII 模式(默认模式)上传,最好将其权限设置为644。

ftp> mput .htaccess mput .htaccess? 200 PORT command successful 150 Opening ASCII mode data connection for .htaccess 226 Transfer complete. ftp: 发送 394 字节,用时 0.00Seconds 394000.00Kbytes/sec.

更多命令请见 ftp> help 或参考 FTP命令详解

发表回复

您的 email 地址不会被公开。 必填信息前已经标志为 *

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>