Web_Developer
Web_Developer

Reputation: 1251

FTP Server doesn't allow me to upload .htaccess file

I am using Amazon EC2 server. Set up a Ubuntu system and ProFTPD Server. Then I create an user to upload files. It works.

But I can't upload .htaccess file. It returns the following error:

 Response:  257 "/public_html" is the current directory
Command:    TYPE A
Response:   200 Type set to A
Command:    PORT 192,168,1,2,200,20
Response:   200 PORT command successful
Command:    STOR .htaccess
Response:   550 .htaccess: Permission denied
Error:  Critical error
Status: Disconnected from server

I am managing things via webmin and through Terminal via ssh. I tried following steps:

DenyFilter *.*/ (Commented this line on the config file of FTP)

Added GLOBAL like this: ListOptions "-la"

But nothing works.

An interesting thing is, I can upload .htaccess file to other directories except "public_html"..

Upvotes: 4

Views: 15047

Answers (1)

Dalex
Dalex

Reputation: 3061

I had the same issue recently and what ultimately did the fix was to simply rename the file for the purpose of uploading (for example .htaccess-new), then rename it back to .htaccess on the live server.

Be sure to save a back up of the original file, and make certain the file permissions match the original (or are set to whatever you might need.)

Upvotes: 6

Related Questions