Pretty URL with a custom variable.

.htaccess and I have never been great friends. She doesn't listen to me and their is a language barrier between us.

Pretty URL's are working fine on all the site for me, except for one place I want to add a custom variable to the URL (for links to a page that grabs data with a $_GET)

This is on a single page. The single page loads find with a pretty url as long as I don't have an additional variables. It loads fine (with no data grab) as 147 is the cID for the page.

For now I have links going to
While this works, I rather a clean link.

something like works
something like would be awesome.
to get the bike name, it would be a query like "SELECT model FROM bikes WHERE bikeID=$_GET[bikeID]" (I know that doesn't work exactly, but just example incase anyone needs query parameters for example).

So if anyone can explain to me what I need to script out to make that would be awesome. A break down of the code so I understand it better even more awesome.

If someone can do the same for would leave me speechless.


View Replies: View Best Answer
ScottC replied on at Permalink Reply
Well you could either write a singlepage, in a singlepage as long as you implement a view method you should be able to redirect based on this variable back to the same controller with different methods args using View::url method.

If you only have say 20 or you want something pretty easy, let me know I've written
and if you'll give it an honest effort to try to get my add-on to work in your particular use case and if it does you'll give it a great review then I will give you a copy in advance.

Thanks and let me know.

JohntheFish replied on at Permalink Best Answer Reply
mrimpatient replied on at Permalink Reply

This worked perfectly. I think I actually read that probably 50 times, but it was a week or two ago, and picked up a lot better understanding of c5 since then, so was able to get it to work this time.

Thanks again!
dclmedia replied on at Permalink Reply
Awesome explanation! This has sorted my problem as well, thanks!!