I can't able to see the .htaccess file

February 26, 2016 526 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 .

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} ^subdomain.yourwebsite.com$
      RewriteCond %{REQUEST
      URI} !^/subdomainfolder/
      RewriteRule (.*) /subdomain

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

Have another answer? Share your knowledge.