Search code examples
apache.htaccessamazon-web-servicesamazon-ec2ssi

Why can't I upload .htaccess file using terminal?


I have a Amazon EC2 server running Apache, I'm trying to enable SSI using .htaccess file, I created the .htaccess file and saved it to my website files folder (not my server), and tried to upload it using scp -i /Users/jeffArries/Desktop/jeffarries.pem /Users/jeffArries/Desktop/Website_Testing_Folder/.htaccess ec2-user@ec2-54-213-219-247.us-west-2.compute.amazonaws.com:/var/www/html in Terminal, and got this error message:

"/Users/jeffArries/Desktop/Website_Testing_Folder/.htaccess: No such file or directory"

How can I upload my .htaccess file to my Apache server using Terminal?

Thanks!

Update: enter image description here Update 2: enter image description here


Solution

  • As can be seen in the output of ls -Abl, the filename is actually .htaccess.txt.

    Side note:

    • Enabling SSI for every .html file is a bad idea performance-wise. THe typical way is to use a special extension (like .shtml), or execute bits on the file (via XBitHack).
    • On Apache 2.4, the current way is to enable the INCLUDES filter instead of using AddHandler:

      AddType text/html .html
      AddOutputFilter INCLUDES .html
      

      AddHandler server-parsed is still supported for backward compatibility.