I have the permissions to create files in /var/www but in a wordpress template I cannot create the .htaccess file to be able to configure the wordpress permalinks.
I have followed this tutorial:
Enable mod_rewrite with the following command:
sudo a2enmod rewrite
Open the file:
sudo nano /etc/apache2/apache2.conf
Uncomment the line (remove the # symbol)
AccessFileName .htaccess
Find the next section
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>
Note: the above section can also be found in the file: /etc/apache2/sites-available/default
Replace “None” with “All” :
AllowOverride All
Restart the Apache service
sudo service apache2 restart
but when I create the file with sudo nano .htaccess and enter the configuration that wordpress gives me, the file is not created within wordpress.
On Linux/Unix files starting with a dot are 'hidden'. They are not seen with a simple 'ls'. You must do an 'ls -a' to include them in the list