Slide # 1

Slide # 1

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 2

Slide # 2

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 3

Slide # 3

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 4

Slide # 4

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

Slide # 5

Slide # 5

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts Read More

03 January 2014

Konfigurasi .htaccess untuk Index.php & URL di CI

File .htaccess adalah file teks sederhana yang terletak di direktori www atau di sebuah sub direktori folder www. anda bisa membuat atau mengedit file ini di Text Editor apapun juga dan kemudian meng-uploadnya ke direktori yang ingin anda ubah setting-nya. Pastikan bahwa file tersebut diupload dalam format ASCII bukan BINARY, . Hal tersebut memungkinkan server untuk mengakses file tapi mencegah user untuk mengakses file tersebut dari browser mereka..contoh dasar File .htaccess
1
Deny from All
bisa kita tambahkan script menjadi :
1
2
3
4
5
6
7
8
9
10
11
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
<Files "*.tpl">
Order Allow,Deny
Deny from All
allow from all
</Files>
fungsi dari codingan diatas :
1
2
3
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
menghilangkan tampilan index.php
1
2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
menyingkat URL menjadi lebih pendek
1
2
3
4
5
<Files "*.tpl">
Order Allow,Deny
Deny from All
allow from all
</Files>
Untuk mencegah user mengakses file .htaccess
diatas perintah singkat wat .htaccess tpi kita bisa menambahkan juga dengan perintah sperti ini
1
2
ErrorDocument 500 /error.html
Override SSI Settings
berfungsi untuk membuat perintah error sesuai dengan keinginan kita sendiri
1
2
3
4
5
order deny,allow
deny from 123.456.789.000
deny from 456.78.90.
deny from .aol.com
allow from all
fungsinya untuk memblok ip atau website tertentu
1
2
3
4
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domainanda.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]
berfungsi untukmencegah orang lain mengakses images secara lansung
1
2
RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC]
RewriteRule ^(.*)$ http://www.domain.tld/$1 [L,R=301]
fungsinya jika kita punya banyak subdomain dan ingin menghilangkan www didepan subdomain kita maka kita harus menggunakan separator operator (OR) ” | ”
seting wat .htaccess dah beres

Show Konversi KodeHide Konversi Kode Show EmoticonHide Emoticon Request Out Of Topic