0

I have a question.

I have a regular site that i want custom urls to point to these pages when user come to the site.

index.html -       custom_index.cfm?custom_id=1&page_id=1&inc=index

about.html -       custom_index.cfm?custom_id=5&page_id=5&inc=about

contactus.html -       custom_contactus.cfm?custom_id=3&page_id=3&inc=contactus

How can i approach that?

Will something like this work?

  if (window.location.search.match(/(\?|&)custom_index.cfm?custom_id=3&page_id=3&inc=contactus($|&)/)) {
Load page
}
user1214467
  • 111
  • 1
  • 1
  • 4
  • Wait, wait, Cold Fusion? Maybe it is beyond your control to have to use it... but you might want to check out this article: http://aralbalkan.com/1864 – summea Feb 16 '12 at 18:35

1 Answers1

0

Apache mod_rewrite should help you here - check out this article that should get you on your way.

Good luck!

Ryan
  • 1,878
  • 1
  • 14
  • 17
  • What's the point? What happens when a website visitor returns to blah.com/about.html and the page doesn't exist so they get a 404 error? You will need to use mod_rewrite to redirect all of your 404 errors to a specific page to handle this when you may as well just write code once rather than thrice - once for your URL rewrite handler in JS, once for your 404 handler to translate and finally your mod_rewrite 404 handler – Ryan Feb 16 '12 at 18:31
  • With 20 seconds of searching I found [this](http://stackoverflow.com/questions/3338642/updating-address-bar-with-new-url-without-hash-or-reloading-the-page) that should give you the answer you're looking for – Ryan Feb 16 '12 at 18:40