Reply to topic
Search Engine Safe URLs (SES)
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
I know there are 4 other threads in the forum regarding this topic, but they are outdated, so I'm revisiting the topic.

I using a SESConverter to change the following url

http://www.example.com/Product.cfm?Prod=11577857

to

http://www.example.com/Product.cfm/Prod/11577857

But as mentioned by some else, the extension(.cfm) still exist on the middle of URL

It would be nice to make it look like:
http://www.example.com/Product/11577857

How, I know HostMySite's URLS are something like..

http://www.hostmysite.com/hosting/vps/windows/cf/

Now I would think they don't have a folder for every url (I could be wrong) but it looks like they are using some type of rewriting.

Has anyone had any success accomplishing such?
Default Type
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
Jason,
I'm not sure if this exists on IIS, although it probably does. I know in Linux, you can set the default file type to ".cfm", so product => product.cfm. Otherwise, I believe it will revert to the file that's there if a .cfm file isn't found. By doing this on IIS, you can probably achieve the desired effect, but I don't know IIS. Or you could use Rails, and this would be really easy Cool. I can dream about it at least.

I didn't know Google discriminated against http://www.example.com/Product.cfm/Prod/11577857
.I thought it was only query parameters, but I might be wrong. As for HMS's urls, I believe they are folders, because I once got a virtual directory listing denied message. Another less efficient method would be to pipe all requests to a 404.cfm file, and have it analyze the cgi.script_name.
pmeserve
HostMySite Tech

Joined: 19 Mar 2004
Posts: 178
Reply with quote
The best way to do this is really with a framework like Rails and Apache + mod_rewrite(or app server like mongrel). All requests just pass into "routing" code within the app, and your own code decides how requests are parsed and processed. I mention Rails because it's what I use, but I'm fairly sure most of the popular frameworks these days support this

You may be able to hack up a solution with IIS & CF, but its going to be hard to do something like:

routes.rb
Code:
map.connect ':controller/:action/:year/:month/:day'


URL: http://app.internal/calendar/show/2007/2/28

Using URLs in this intuitive, human-friendly way is very appealing. Tossing it all in as GET-variables is so 2004 Wink
Coldfusion
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
You may be able to hack up a solution with IIS & CF, but its going to be hard to do something like:
Right, if only Jason was running Rails.. this would be pretty easy. I'm not a windows guy though... can you set default types in IIS? If so, it could work.

You mention that all routes should be centralized, and i've seen a couple sites use 404's to route requests in Coldfusion, but then again...
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
As much as I would like to move to rails, my employer is 100% Windows and CF. We contract out everything that is not ColdFusion. (.Net Apps, etc) So I'm here 8 hours a day coding CF Rolling Eyes (call me crazy but I love it)

Maybe sometime in my personal time I'll attempt rails.

Anywho..thanks for the info on the URLS. Like Paul said, my ultimate goal is to get a url to look like:

URL: http://app.internal/calendar/show/2007/2/28

And not have the URL params in it:

URL: http://app.internal/calendar.cfm?action=show&year=2007&mon=2&day=28

I've read a few places about using some JRun connectors and/or IIS filters. But we all know that HMS won't let you run such a thing in the shared environments. So I'll keep hunting. Smile
Environments
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 343
Reply with quote
As much as I would like to move to rails, my employer is 100% Windows and CF. We contract out everything that is not ColdFusion. (.Net Apps, etc) So I'm here 8 hours a day coding CF Rolling Eyes (call me crazy but I love it)

Just curious, don't you have control over WaveWork's environments? Or is it a part-time gig.
maryjos


Joined: 30 Jul 2006
Posts: 10
Reply with quote
Don't know if you've found a solution by now or not, since this is kind of an old thread. But you certainly can do this on CF as well...you just need to have something like mod-rewrite on the server. For Windows, most people use ISAPI_Rewrite. If you are in a shared environment and cannot use these, well there's really no way to replace the file name in the middle that I know of. If there is, I'd love to know about it!
Search Engine Safe URLs (SES)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic