creating a uri or url?

im not sure if ive worded my question correct.

but im building a webservice about books but im not sure how i can get the isbn into the url like how my lecturer has done it eg.

so where the numbers are. This is part of a put method for adding a book to the database.

im going to use something similar for users but im not sure how to put the isbn that the user submits into the uri?

In an Apache-environment you could use the module mod-rewrite to rewrite (d’uh) the url to your liking

this url: (1)

could be rewritten to (2)

This means that a user who visits the #1 url will be silently served the #2 url. You can then use the isbn number in your php application using $_GET[‘isbn’]

You can create simple rewrites here:

Example at the mod rewrite generator

module: value
isbn: name and value

prefix (not needed really, but just to get it exactly like your example pretty url)


results in:


You should add this code to a .htaccess file in the folder you have the script in

RewriteEngine On RewriteRule ^index\.php/([^/]*)/isbn/([^/]*)$ /index.php?module=$1&isbn=$2 [L]

if you need to be able to send more get variables you must add QSA (attach query string) in addition to the L

RewriteEngine On RewriteRule ^index\.php/([^/]*)/isbn/([^/]*)$ /index.php?module=$1&isbn=$2 [L,QSA]

Sponsor our Newsletter | Privacy Policy | Terms of Service