在IIS7 URL重写的Word preSS [英] URL Rewrite on IIS7 for Wordpress

查看:146
本文介绍了在IIS7 URL重写的Word preSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的共享与IIS7和支持PHP托管。我试图运行具有pretty网址(删除的index.php)一词preSS博客。托管服务提供商不希望安装URLRewrite模块,这样的选择是不提供给我。我发现字preSS一个插件,将固定链接网址中删除的index.php和改变404页的index.php到是应该做的伎俩...这是不工作无论是。

I am using shared hosting with IIS7 and support for PHP. I am trying to run a wordpress blog with "pretty urls" (removing index.php). The hosting provider doesn't want to install the URLRewrite module, so that option isn't available to me. I found a plugin for wordpress that will remove the index.php from permalink URLs and changing the 404 page to index.php is supposed to do the trick... that isn't working either.

我熟悉的URL重写为ASP.NET网站,但我不知道我怎么会去了解它为PHP。托管设置似乎支持ASP.NET和PHP在同一时间,所以我想这将有可能通过ASP.NET运行重写code,但我不知道如何去做。

I'm familiar with URL rewriting for an ASP.NET website, but I'm not sure how I would go about it for PHP. The hosting setup seems to support ASP.NET and PHP at the same time, so I'm thinking it would be possible to run the rewrite code through ASP.NET, but I'm not sure how to go about it.

有谁有这个任何经验或即将采取的最佳方法的任何想法。如果有什么让我在正确的方向,或者如果我找出自己,我会很乐意在这里分享了code给其他人,可能需要它。

Does anybody have any experience with this or any ideas about the best approach to take. If anything leads me in the right direction or if I figure it out myself, I will be more than happy to share the code here for anybody else that may need it.

推荐答案

感谢大家的建议。

我的主人最终安装 IIRF 并它的工作就像一个魅力。有一个名为IsapiRewrite4.ini的重写规则文件。为了得到我的Word preSS没有安装在URL中的index.php运行时,所有我所要做的就是补充:

My host ended up installing IIRF and it worked like a charm. There is a file called IsapiRewrite4.ini for the rewrite rules. In order to get my Wordpress install running without the index.php in the URL, all I had to do was add:

RewriteRule ^/sitemap.xml$   - [L]
RewriteRule ^/(?!index.php)(?!wp-)(.*)$ /index.php/$1

第一行允许一个sitemap.xml的文件请求。第二行处理从URL中移除的index.php。这似乎是从性能的角度来看细为好,我还没有看到任何问题的页面响应缓慢的。

The first line allows requests for a sitemap.xml file. The second line handles removing index.php from the URL. It seems to be fine from a performance standpoint as well, I haven't seen any issues with pages responding slowly at all.

希望这将有助于别人谁需要类似的功能。

Hopefully this will help somebody else who needs similar functionality.

这篇关于在IIS7 URL重写的Word preSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆