.htaccess is a configuration file for use on web servers running on the web apache server software. when a .htaccess file is placed in a directory which in turn loaded via the Apache web server, then the .htaccess file detected and executed by the Apache server software.
.htaccess htaccess can be mod the setup of the Apache server software to empower additional functionality and fetures that the apache web server softwatre brings to the table. We can use the .htaccess file for alteration various configuration in softache web server stm. Somewious configuration in softache web serverc. Somewion them.
#ErrorDocumentsCreating custom error pages is very useful, it allows us to show web site visitors a friendly error message, in case of if a URL on your web site does not 3.密碼保護
ErrorDocument 404 /error_pages/404.html
第一行告訴Apache Web伺服器安全目錄被稱為'Admin Area',當彈出登入提示出現時,這將被顯示出來。隨後的一行指示密碼檔案的位置。第三行確定了認證類型,在這個例子中,我們使用'Basic',因為我們使用基本的HTTP認證,最後第四行表示我們需要有效的登入憑證
##重定向重定向使我們能夠將網站訪客從網站中的一個文件重新導向到另一個文件。AuthName "Admin Area" AuthUserFile /path/to/password/file/.htpasswd AuthType Basic require valid-user
Redirect /old_dir/ http://www.test.com(your domain)/new_dir/index.html
order allow,deny deny from 155.0.2.0 deny from 123.45.6.1 allow from all
以上是.htaccess是PHP中的什麼?的詳細內容。更多資訊請關注PHP中文網其他相關文章!