Error during FTP upload, permission denied at:"/.htaccess"

Hello I am getting this error while editing /.htaccess. My goal is to redirect http to https. Can you help me solve the problem? thank you…

You cannot edit this .htaccess file, instead you must create a new one inside htdocs.


thank you

1 Like

Inside the “htdocs” directory create a file called .htaccess and write the following:

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

You can also make your website redirect to a custom 404 page, 505… etc:

ErrorDocument 400
ErrorDocument 401
ErrorDocument 403
ErrorDocument 404
ErrorDocument 503

I leave you a guide in case you are interested in some more options :slight_smile:


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.