0

Maybe this is a silly question but I spend much time through google and this site to search and read about this topic but it doesn't help.

My concern is how can I or is it possible to manipulate $_GET in URL using PHP and .htaccess? Let say I want to change:

detail.php?pro=abcd into detail/abcd/

So, whenever user hover or click on a link, it will display detail/abcd instead of detail.php?pro=abcd. I find a piece of code below to get it done using htaccess but i don't get any php code.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^shop/sales/?$ sales.php
RewriteRule ^shop/([A-Za-z\+]+)/?$ shop.php?type=$1
</IfModule>

I really appreciate any help and thanks a lot

Greg
  • 11,654
  • 3
  • 44
  • 50
  • _i don't get any with php code_? What PHP code are you trying to find? `header('location: ... ');`? – putvande Jan 10 '14 at 10:42
  • `RewriteRule ^detail/([A-Za-z\+]+)/?$ detail.php?pro=$1`? This is simply changing a very few things in your htaccess that you already have? – h2ooooooo Jan 10 '14 at 10:44

1 Answers1

0

You want to create friendly URL's.

This question has been asked many times before, see this answer for information on how to do this.

https://stackoverflow.com/a/812578/1209020

Community
  • 1
  • 1
Ryan
  • 3,552
  • 1
  • 22
  • 39