简体   繁体   English

.htaccess:不在www base目录中的位置

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

I may need to modify our .htaccess file. 我可能需要修改.htaccess文件。 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. 我们在vhosts目录中有几个子域,每个子域都有一个关联的.htpasswd文件。 How can find where the .htaccess file is. 如何找到.htaccess文件的位置。

Obviously, I didn't set this up and I'm certainly not known as an unix admin expert. 显然,我没有设置它,我当然不是一个unix管理员专家。

. (dot) files are hidden by default on Unix/Linux systems. (点)文件在Unix / Linux系统上默认隐藏。 Most likely, if you know they are .htaccess files, then they are probably in the root folder for the website. 最有可能的是,如果您知道它们是.htaccess文件,那么它们可能位于网站的根文件夹中。

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. 如果您使用的是GUI应用程序,请查找“显示隐藏文件”或类似设置。

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. 这将列出它使用该名称找到的任何文件。

The .htaccess is either in the root-directory of your webpage or in the directory you want to protect. .htaccess位于网页的根目录中或要保护的目录中。

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. 确保在文件系统中显示它们,因为默认情况下,在unix系统上,以句点开头的AFAIK(我也不是unix专家)文件是不可见的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM