mod_rewrite - Part 3: build your own "fantasy" URL
mod_rewrite tutorial: In this tutorial, I will show you how to make "bestethnic.html" to instead "product.php?id=3". Before you read, make sure you have understood part 1 and part 2 from this series.
Assume, you work on www/product (it root folder for www.yoursite.com).
Ok, folow this steps:
1. Create .htaccess on your folder.2. Write this code:
RewriteEngine On # translate bestethnic.html to product.php?id=3 RewriteRule ^bestethnic\.html$ product.php?id=3
4. write this code at product.php
<?php echo "you have choose product id: #".$_GET['id']; >
Catch idea?
| Series this article: mod_rewrite - Part 1: create your "fantasy" URL mod_rewrite - Part 2: Instalasi modules in Apache mod_rewrite - Part 3: build your own "fantasy" URL Tag: mod_rewrite, url, apache module Category: Apache Post : October 09th 2007 Read: 2,660 blog comments powered by Disqus |
