2015-08-26 53 views
0

這裏是我的代碼要啓用特定頁面上htaccess的密碼功能CakePHP中

<IfModule mod_rewrite.c> 
    RewriteEngine on 
    RewriteRule ^$ app/webroot/ [L] 
    RewriteRule (.*) app/webroot/$1 [L] 
</IfModule> 
<LocationMatch "http://<server name>/bikes/brand/index/*"> 
    AuthType Basic 
    AuthName "restricted area" 
    AuthUserFile "/home/public_html/sites/labs/bikes/.htpasswds" 
    require valid-user 
</LocationMatch> 

其實我想啓用htaccess的密碼只有一個頁面,頁面鏈接是類似於http:///自行車/家庭/索引/

但我沒有任何其他page.thanks

回答

0

嘗試使用此代碼想htaccess的密碼,把它添加到你的.htaccess,並請參閱本link

<Files "index.php"> 
    Require valid-user 
</Files> 
+0

謝謝阿希什,但我實際上使用cakephp,所以我不能給你喜歡的文件名。 –