Remove number from URL possible?

4 posts by 4 authors in: Forums > CMS Builder
Last Post: November 6, 2009   (RSS)

By goodonyx - November 5, 2009

Just wondering if it is possible through URL rewriting with htaccess to hide the number at the end of the viewer URL.

Example:
http://www.site.com/details.php?Overview-4

to

http://www.site.com/details.php?Overview

thanks,

Re: [goodonyx] Remove number from URL possible?

By willbegood - November 6, 2009

Is it possible or not?
If yes it will solve my problem.

I don't now why but when i remove num from url, some data (called from an included php file) are displaying.

With NUM, it said "no record" really strange.

Re: [goodonyx] Remove number from URL possible?

By Dave - November 6, 2009

Yes, you can have pretty much any kind of custom url you want. The only issue is that you need to figure out the custom code to work with your preferred url format. We can point you in the right direction with this, but you may need some custom programming to make it work (from us or anyone who knows PHP & MySQL)

If you don't want to use numbers you need to use something else to unique identify a record so CMSB knows what to show.

Here's an example of the type of advanced custom code you'd need:

You can get the value after the ? with $_SERVER['QUERY_STRING']

So if you had details.php?Overview and "Overview" was the exact value of your 'title' field you could lookup records like this:
'where' => " title = '" .mysql_real_escape_string($_SERVER['QUERY_STRING']). "' ",

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com