yii
(jammi )
December 23, 2009, 10:42am
1
Hallo,
wie habt ihr es gelöst das eure Verzeichnisse (protected, views, etc.) nicht über die URL abrufbar sind?
Der Index der Verzeichnisse wird zwar nicht angezeigt, aber wenn man die URL zu einer Datei kennt, bsp.www.example.com/protected/yiic so wird diese angezeigt.
mbi
(mbi)
December 23, 2009, 10:51am
2
das sollte eigentlich nicht der fall sein, da die .htaccess dieses Verzeichnis schützt
thyseus
(Thyseus)
December 23, 2009, 10:55am
3
Prüfe, ob deine .htaccess existiert. Manchmal kann es beim verschieben oder kopieren vorkommen, dass diese auf der Strecke bleibt.
Aus dem Manual:
Application Base Directory
Application base directory refers to the root directory that contains all security-sensitive PHP scripts and data. By default, it is a subdirectory named protected that is located under the directory containing the entry script. It can be customized via setting the basePath property in the application configuration.
Contents under the application base directory should be protected from being accessed by Web users. With Apache HTTP server, this can be done easily by placing a .htaccess file under the base directory. The content of the .htaccess file is as follows,
deny from all
yii
(jammi )
December 23, 2009, 11:42am
4
Meine .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(hr|www)\.example\.com
RewriteRule ^ http://www.example.com%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
RewriteRule !.+ index.php [L]
Wenn ich dort, deny from all aufnehmen würde, dann könnte ich nicht mehr auf die Seite zugreifen
mbi
(mbi)
December 23, 2009, 12:48pm
5
eine .htaccess nur mit ‘deny from all’ ins protected-Verzeichnis packen