hi, how can i replace the "?id=" get function and replace it with a "/".
for example..
http://example.com/items/partnumberhere
thanks in advance 🙂
mod_rewrite
how can i use this for my task, i could not find anything on that page.
is it possible to get the url and remove everything before two slashes?
Something like this might work:
RewriteEngine On RewriteRule ^items/([0-9]+)$ item.php?id=$1
If your part numbers aren't numeric, then you could change the [0-9] to . so that all characters are allowed.
is this for htaccess?
Yes, .htaccess is where you configure Apache's mod_rewrite, assuming it has been loaded.
how can i change this...
http://example.co.uk/item.php?id=92
to
http://example.co.uk/item/92
Which is the URL that you want to be seen? In other words, which is the URL you would type into a browser? If that's the second one, then I've already posted the code to do that.
hi, yes its the 2nd one. how can i get it to read item.php? Do i have to create a folder with item.php -> index.php?
No, you don't need to create any folders. You only need item.php and a .htaccess file with the code I've already provided above.