Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess: where is located when not in www base dir

I may need to modify our .htaccess file. Problem is I can't find it. We have several subdomains along side each other in the vhosts directory, and each subdomain has an associated .htpasswd file. How can find where the .htaccess file is.

Obviously, I didn't set this up and I'm certainly not known as an unix admin expert.

like image 817
Jahmic Avatar asked Aug 04 '11 06:08

Jahmic


People also ask

Where is the location of .htaccess file?

htaccess file is located in the root directory of your WordPress site. Depending on your hosting provider, the root directory may be a folder labelled public_html, www, htdocs, or httpdocs. You can locate it by using File Manager in your hosting account's cpanel.

Where is my .htaccess file Apache?

htaccess file can be found at installdir/APPNAME/. htaccess. Some applications do not have the installdir/apache2/conf/vhosts/htaccess/APPNAME-htaccess.

Where is .htaccess file in localhost?

htaccess file in \dev\www\ directory, and your . htaccess file has something like RewriteRule ^(.


2 Answers

. (dot) files are hidden by default on Unix/Linux systems. Most likely, if you know they are .htaccess files, then they are probably in the root folder for the website.

If you are using a command line (terminal) to access, then they will only show up if you use:

ls -a

If you are using a GUI application, look for a setting to "show hidden files" or something similar.

If you still have no luck, and you are on a terminal, you can execute these commands to search the whole system (may take some time):

cd /
find . -name ".htaccess"

This will list out any files it finds with that name.

like image 100
OverZealous Avatar answered Oct 07 '22 01:10

OverZealous


The .htaccess is either in the root-directory of your webpage or in the directory you want to protect.

Make sure to make them visible in your filesystem, because AFAIK (I'm no unix expert either) files starting with a period are invisible by default on unix-systems.

like image 43
Quasdunk Avatar answered Oct 07 '22 02:10

Quasdunk