I set up htaccess file and when I tried to save it I am informed that no such file exists.

I wanted to set up custom rewrite rules in my htaccess file as I have installed wordpress. I followed this article to the dot

I opened my htaccess file, edited it and tried to save it. I am informed that No such file or directory exists. I have no clue to sort it out.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Does <code>/var/www/</code> exist? If yes, you can simply ignore that error and save the file.

I did the following steps <br> <br>******************** <br>Alternatively you can use this command, replacing the with the name of your site, to create your .htaccess file in terminal. <br>sudo nano /var/www/ <br> <br>How to permit changes in the .htaccess file: <br>To allow the .htaccess file to override standard website configs, start by opening up the configuration file. NB: You will need sudo privileges for this step. <br> <br>sudo nano /etc/apache2/sites-available/default <br> <br>Once inside that file, find the following section, and change the line that says AllowOverride from None to All. The section should now look like this: <br> <Directory /var/www/> <br> Options Indexes FollowSymLinks MultiViews <br> AllowOverride All <br> Order allow,deny <br> allow from all <br> </Directory> <br> <br>After you save and exit that file, restart apache. .htacess files will now be available for all of your sites. <br> <br>sudo service apache2 restart <br> <br> <br>then <br> <br>sudo nano /var/www/ <br> <br>********************************* <br> <br>edited it and tried to save it and that is when the problem occurred

What command are you using to edit the file? Make sure the path exists.