3

.htaccessファイルを非表示にして、誰もがブラウザで読み込めないようにしています。

私の.htaccessファイルはここにあります:http://businessgame.be/.htaccessご覧 のとおり、まだ読み上げることができます。

以下を追加してみました:

# secure htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>

そしてまた

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

しかし、どれもうまくいかないようです。これは本当に奇妙です。私は何か間違ったことをしていますか?

4

2 に答える 2

6

この .htaccess ファイルのサンプル コードに従うだけです...

<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
<IfModule mod_rewrite.c>
RewriteEngine On
ErrorDocument 404 /404.php
</IfModule>
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(yourwebsite.com)(:80)? [NC]
RewriteRule ^(.*) http://www.website.com/$1 [R=301,L]
DirectoryIndex index.php       
order deny,allow
Header unset ETag
FileETag None

<FilesMatch "\.(jpg|png|gif|js|css|ico|swf)$">
Header set cache-Control: "max-age=572800, must-revalidate"
</FilesMatch>

これは私たちにとってより役立つでしょう.....

そうでなければ、それはあなたを助けるでしょう...

  <Files ~ "\.html$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files ~ "\.css$">
Order allow,deny
Deny from all
Satisfy All
</Files>

それ以外の場合はうまく機能します..私は自分のウェブサイトでこのコードをチェックします。

  Options +FollowSymlinks
 # Prevent Directoy listing 
Options -Indexes
# Prevent Direct Access to files
# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

あなたに機会を与えてくれてありがとう...

于 2013-05-16T10:12:10.147 に答える