Remove number from URL possible?

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

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 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

Re: [willbegood] Remove number from URL possible?

By ross - November 6, 2009

Hi willbegood

Dave replied to the first post with some options about changing the URL's but I actually think your situation might be a little different.

Can you check the page you are having trouble with and see if you have two different viewers on it? I think the problem is that when you have the number in the URL, it's actually triggering the search option in one of your viewers and that's causing the problem.

Have a look and let me know. We can go over how to fix that from there.

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/