I can't able to see the .htaccess file

Posted February 26, 2016 14.6k views

I can’t see the .htaccess file

/etc/apache2/sites-available# ls
000-default.conf default-ssl.conf dindudu.conf script.conf site.conf

how to make the .htaccess file .

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.

Submit an Answer
1 answer

Files that begin with a dot “.” are hidden on Linux systems so they will not show up when you just run ls. Instead use ls -a and all files will be shown whether they are hidden or not.

  • Also, .htaccess files do not go in /etc/apache2/sites-available This is only for apache configuration files. .htaccess files are placed in the directory in your web root where they will be used (often the webroot).

    • RewriteCond %{HTTPHOST} ^$
      RewriteCond %{REQUEST
      URI} !^/subdomainfolder/
      RewriteRule (.*) /subdomain

      I don’t want to show the sub folder
      where i want to put this code