如何使用PHP + IIS实现URL路由?

编程入门 行业动态 更新时间:2024-10-26 18:23:23
本文介绍了如何使用PHP + IIS实现URL路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我编写了一个内容切换器脚本,该脚本使用动态URL来传递指示要发送哪些数据的参数。

I wrote a content switcher script that uses dynamic URLs to pass parameters indicating what data is to be sent.

例如,要查看您要输入的关于页面: www.example/?page=about

For example to view the about page you would type: www.example/?page=about

问题在于这不是用户友好的,特别是在我的情况下,用户不一定会通过主页上的链接访问此页面。

The issue is that this is not user friendly especially in my case where users will not necessarily be accessing this page via a link from the home page.

我希望网址看起来像是: www.example / about /

What I would rather have the URL look like is: www.example/about/

不幸的是我在IIS平台上运行PHP5,而不是Apache,因此这消除了使用mod-rewrite的最常用方法。

Unfortunately I am running PHP5 on an IIS platform, not Apache, so this eliminates the most common methods that use mod-rewrite.

我正在寻找如何使用PHP + IIS进行URL路由的示例。

I'm looking for examples of how to do URL Routing with PHP + IIS.

可以在IIS 7.5平台上完成吗?

Can it be done on the IIS 7.5 platform?

推荐答案

由于您使用的是IIS 7,因此可以使用现在可用的新重写支持。

Since you're using IIS 7, you can use the new rewriting support that's now available.

查看 www.iis/learn/extensions/url-rewrite-module/ using-the-url-rewrite-module

更多推荐

如何使用PHP + IIS实现URL路由?

本文发布于:2023-10-26 01:12:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1528640.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路由   如何使用   IIS   PHP   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!