是否有一个“干净的 URL”? (mod_rewrite) 相当于 iPlanet?
我正在使用 Coldfusion(因为我必须这样做)并且我们使用 iPlanet 7(因为我们必须这样做),并且我想传递干净的 URL 而不是查询参数垃圾(出于多种原因)。我的问题是我无权访问整个 obj.conf 文件,并且想知道是否有 .htaccess 等效项可以在每个目录中动态传递。目前,我正在使用 Application.cfc 强制服务器在加载请求的页面之前查看根目录中的 index.cfm,但这需要 .cfm 文件,因此如果用户提供 /path/to/file 但没有扩展名,则只会出现 404 错误。最终,我想允许用户传递 domain.com/path/to/file 但提供 domain.com/index.cfm?q1=path&q2=to&q3=文件。有什么想法吗?
I'm working with Coldfusion (because I have to) and we use iPlanet 7 (because we have to), and I would like to pass clean URL's instead of the query-param junk (for numerous reasons). My problem is I don't have access to the overall obj.conf file, and was wondering if there were .htaccess equivalents I could pass on the fly per directory. Currently I am using Application.cfc to force the server to look at index.cfm in root before loading the requested page, but this requires a .cfm file is passed, so it just 404's out if the user provides /path/to/file but no extension. Ultimately, I would like to allow the user to pass domain.com/path/to/file but serve domain.com/index.cfm?q1=path&q2=to&q3=file. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 DirectoryIndex 指令来 mod_dir 来设置在 /directory/ 请求上提供哪个页面。
http://httpd.apache.org/docs/2.2/mod/mod_dir.html
You can mod_dir with the DirectoryIndex directive to set which page is served on /directory/ requests.
http://httpd.apache.org/docs/2.2/mod/mod_dir.html
我不确定 iPlanet 存在什么,以前没有使用过它。但可以使用像index.cfm/path/to/file 这样的url,并通过cgi.path_info 变量提取额外的路径信息。不完全是您正在寻找的内容,但查询参数更清晰。
I'm not sure what exists for iPlanet, haven't had to work with it before. But it would be possible to use a url like index.cfm/path/to/file, and pull the extra path information via the cgi.path_info variable. Not exactly what you're looking for, but cleaner that query-params.