เพิ่มหัวข้อใหม่
สั่งพิมพ์

HTACCESS Cheat Sheet

http://journal.kentreez.com/

Just look around~

TOP

.htaccess สำหรับเปิด register_global สำหรับ osCommerce

php_value register_global on
ไฟลล์แนบ: ระดับของกลุ่มสมาชิกนี้ไม่สามารถมองเห็นไฟลล์แนบได้
http://journal.kentreez.com/

Just look around~

TOP

.htaccess สำหรับปิดการแสดงข้อผิดพลาดสำหรับ Joomla

php_value display_errors off
ไฟลล์แนบ: ระดับของกลุ่มสมาชิกนี้ไม่สามารถมองเห็นไฟลล์แนบได้
http://journal.kentreez.com/

Just look around~

TOP

บล๊อก IP


<limit GET POST PUT>
order allow,deny
deny from 89.149.242.0/255.255.255.0
allow from all
</limit>
http://journal.kentreez.com/

Just look around~

TOP


สำหรับแสดง File , Folder

Options +Indexes
http://journal.kentreez.com/

Just look around~

TOP

สำหรับไม่แสดง File , Folder

Options -Indexes

http://journal.kentreez.com/

Just look around~

TOP

ลำดับความสำคัญของไฟล์ที่จะเปิด ในกรณีที่เข้าผ่าน URL ที่ไม่ระบุไฟล์

DirectoryIndex index.html index.htm index.php


เรียงความสำคัญจาก ซ้ายไปขวา
http://journal.kentreez.com/

Just look around~

TOP

redirect domain.com to www.domain.com


RewriteEngine On
RewriteCond %{HTTP_HOST} !www.domain.com
RewriteRule ^.*$     http://www.%{SERVER_NAME}%{REQUEST_URI} [R]



เติม .html ให้เอง จะได้เข้าแบบไม่ต้องใส่ .html ได้

RewriteEngine On
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [QSA,L]
http://journal.kentreez.com/

Just look around~

TOP

AddDefaultCharset UTF-8

<FilesMatch "\.(htm|html|css|js)$">
ForceType 'text/html; charset=UTF-8'
</FilesMatch>


<FilesMatch "\.(htm|html|css|js)$">
AddDefaultCharset UTF-8
</FilesMatch>


AddCharset UTF-8 .html

AddType 'text/html; charset=UTF-8' html

TOP

เพิ่มหัวข้อใหม่