Latihan PHP 4 – file .htaccess

Kali ini kita akan membuat file .htaccess yang akan kita gunakan untuk mempercantik url kita nantinya heheheee pengennya sih gitu :D.
Oke langsung aja kita buat file .htaccess seperti berikut :

RewriteEngine On

RewriteRule ^([^/]*)\.html$ index.php?page=$1 [L]

RewriteRule ^([^/]*)/([^/]*)\.html$ index.php?page=$1&id=$2 [L]

RewriteRule ([^/]*)/hal/([^/]*)\.html$ index.php?page=$1&hal=$2 [L]

Ini hanya file .htaccess sederhana aja klo punya yang lebih bagus sok dipake aja :D.
Simpan file ini sejajar dengan file index.php .

Advertisements
This entry was posted in php. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s