海关URL /深层链接

问题描述:

我有问题。海关URL /深层链接

我有一个固定网站,我希望自定义网址指向这些网页,当用户来到网站。

的index.html - custom_index.cfm custom_id = 1 & PAGE_ID = 1个& INC =指数

about.html - ?custom_index.cfm custom_id = 5 & PAGE_ID = 5 & INC =约

contactus.html - custom_contactus.cfm custom_id = 3 & PAGE_ID = 3 & INC =联系我们

我该如何解决这个问题?

会是这样的工作?

if (window.location.search.match(/(\?|&)custom_index.cfm?custom_id=3&page_id=3&inc=contactus($|&)/)) { 
Load page 
} 
+0

等等,冷聚变?也许你无法控制它的使用......但你可能想看看这篇文章:http://aralbalkan.com/1864 – summea 2012-02-16 18:35:39

阿帕奇mod_rewrite应该帮助你在这里 - 看看this article,应该让你对你的方式。

祝你好运!

+0

关于Javascript – user1214467 2012-02-16 18:28:12

+0

有什么意义?当网站访问者返回到blah.com/about.html并且该页面不存在时会发生什么情况,从而导致404错误?您需要使用mod_rewrite将所有404错误重定向到特定页面以处理此问题,因为您可能只需编写一次代码而不是三次 - 一次是用于JS中的URL重写处理程序,一次是用于404处理程序的翻译和终于你的mod_rewrite 404处理程序 – Ryan 2012-02-16 18:31:33

+0

20秒的搜索我发现[这](http://*.com/questions/3338642/updating-address-bar-with-new-url-without-hash-or-reloading-the - 页面),应该给你你正在寻找的答案 – Ryan 2012-02-16 18:40:20