我知道这个问题已被多次询问,而且我查看了很多论坛的答案,但是: 使用终端检索隐藏文件后,我仍然找不到.htaccess文件。我还使用了文本管理器,当我打开并键入名称时,没有.htaccess。 因此,我错过了一招?我需要创建一个吗? 我在apache> http.conf中找到了要更改的部分。如果他们输入了URL,我不希望找到php文件,而是希望用户只能通过登录页面访问它。 非常感谢任何帮助。
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.php
<IfModule perl_module>
DirectoryIndex index.pl
</IfModule>
<IfModule wsgi_module>
DirectoryIndex index.wsgi index.py
</IfModule>
</IfModule>
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
<Files ~ "^\.DS_Store">
Order allow,deny
Deny from all
</Files>
<Files login.php>
Order Allow,Deny
Allow from all
</Files>