问题描述
我有一个博客,并配置目前的服务器是一个大热的一塌糊涂。
I have a server with a blog and the configuration right now is a big hot mess.
这是一个.NET服务器上运行一把umbraco和博客托管与内字preSS。你可以想象一把umbraco的web.config中似乎覆盖PHP的设置。
It's a .NET server running umbraco and the blog is hosted with wordpress within that.As you can imagine the web.config of umbraco seems to override the PHP settings.
我要的是这是www.mydomain.com/blog从blog.mydomain.com访问的博客。我已经添加了对blog.mydomain.com和等待,看看是否会工作的A记录,但我不知道我是否还需要一些301重定向到位?
What I want is the blog which is "www.mydomain.com/blog" to be accessed from "blog.mydomain.com".I've added an A record on blog.mydomain.com and waiting to see if that'll work, but I'm not sure if I also need some 301 redirect in place?
更重要的是所有的博客链接崩溃,因为MYDOMAIN /博客/不走的index.php(一把umbraco使Default.aspx的,即使index.php文件被列为默认的IIS默认页面)。
More importantly all the blog links crash because mydomain/blog/ doesn't go to index.php(Umbraco makes default.aspx the default page even if index.php is listed as default on IIS).
有一个重写规则,这将使中的博客文件夹的所有空斜线默认的index.php?
Is there a rewrite rule that will make all empty slashes within the blog folder to default to index.php?
我发现这是一个有点希望的,但只能在父文件夹:我需要的东西,将工作在博客的所有子文件夹
I found this is a bit promising but will only work on the parent folder:I need something that will work on all subfolders of blog
<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<add name="gotoindex"
redirect="Domain"
ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
virtualUrl="http://mysitename/"
redirectMode="Permanent"
destinationUrl="http://mysitename/index.php" />
</rewrites>
</urlrewritingnet>
此外,我想查询字符串preserved。目前,该链接看起来是这样的: http://mydomain.com/blog/?m=201208我将最好要转发到 http://mydomain.com/blog/index.php? M = 201208
Also I want the query string preserved.Currently the links look like this: http://mydomain.com/blog/?m=201208which I would ideally want forwarded to http://mydomain.com/blog/index.php?m=201208
任何帮助是非常AP preciated。这里真的失去了!谢谢
Any help is very appreciated.Really lost here!! Thanks
推荐答案
我已经解决了。
关键是要做到这一点:
<add key="umbracoReservedPaths" value="~/umbraco,~/install/, /blog/" />
通过添加例外web.config中,博客的文件夹已不再约束一把umbraco配置和PHP在IIS设置开始工作!
By adding an exception to the web.config, blog folder was no longer bound the umbraco configuration and the IIS settings for PHP started working!
另外这个规则也是固定的,从blog.mydomain.com重定向到www.mydomain.com/blog~~V
Also this rule also fixed the redirect from blog.mydomain.com to www.mydomain.com/blog
添加此键UrlRewriting.config
Add this key to UrlRewriting.config
<add name="blogfix" virtualUrl="^http\://blog.mydomain.co.uk/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="http://www.mydomain.co.uk/blog/$1"
redirect="Domain"
redirectMode="Permanent"
ignoreCase="true" />
这篇关于.NET服务器上的PHP配置 - 网址重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!