i created a php website and i got my 1 problem which is remove the query string in the URL using htaccess.
Host Directory from public_html
- index.php
- product.php
In the index.php i put a link on a query from database
<a href="product.php?id=<?php echo $row['P_ID']; ?><?php echo $row['P_ID']; ?></a>
It will redirect in product.php to show the specific product, let just say you select or click product id 100 it will show the details of that product id. and the URL is www.mysite.com/product.php?id=100.
In the product.php i used the code
<?php $pid = intval($_GET['id']); ?>
to get the details of the specific product in the product.php page.
I want to remove my query string in the URL using .htaccess with the following code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ product.php?id=$1
But it doesn't help me to remove the query string. I want my URL clean for sql injection attack. So it would be look like this after the query string clean www.mysite.com/product/100
I need help for this in advanced.