0

Is it possible to change

host/index.php?variable=3

to

host/index.php/3


In my instance I'm using

host/bot?id=3

But I'd like it to be

host/bot/3 <-- This will be the only variable EVER used

How can I accomplish this, any links or code you can provide?

Thanks in advance!

  • 1
    I believe you'll find the answer here http://stackoverflow.com/a/16389034/1352271 – JohnnyFaldo Apr 27 '16 at 15:55
  • 2
    Possible duplicate of [URL rewriting with PHP](http://stackoverflow.com/questions/16388959/url-rewriting-with-php) – Nick Apr 27 '16 at 16:52

1 Answers1

0

GET /hotels/:id Hotels.Show

Segments of the path may be matched and extracted with a : prefix. The :id variable above will match anything except a slash. For example, /hotels/123 and /hotels/abc would both be matched by the route above. Extracted parameters are available in both the Controller.Params map and via Action method parameters.

https://revel.github.io/manual/routing.html