<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>301 on heartnn的自留地</title><link>https://www.heartnn.com/tags/301/</link><description>Recent content in 301 on heartnn的自留地</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><copyright>&amp;copy;2008-2022 heartnn的自留地</copyright><lastBuildDate>Thu, 03 Mar 2016 11:39:12 +0800</lastBuildDate><atom:link href="https://www.heartnn.com/tags/301/index.xml" rel="self" type="application/rss+xml"/><item><title>关于Ghost下的301跳转</title><link>https://www.heartnn.com/2015/12/08/ghost-301-redirect/</link><pubDate>Tue, 08 Dec 2015 02:51:05 +0800</pubDate><guid>https://www.heartnn.com/2015/12/08/ghost-301-redirect/</guid><description>&lt;p>借着升级0.7.2，一起解决了non-www向www的域名跳转问题，本来是个很简单的问题，就因为Openshift的特殊性，变的复杂起来。&lt;/p>
&lt;p>如果Google这个问题的话，会有&lt;a href="http://codenimbus.com/2014/01/15/redirecting-www-domain-to-non-www-on-ghost/">www向non-www跳转的解决办法&lt;/a>，并且似乎需要修改&lt;code>core/server/routes/frontend.js&lt;/code>，而且容易引起重定向循环。&lt;/p>
&lt;p>如果用nginx反向代理的话应该会很简答，用Apache的话也可以用&lt;code>.htaccess&lt;/code>解决，但是Openshift里的Nodejs自带的Apache似乎没有mod_rewrite。&lt;/p>
&lt;p>所以结论是在Openshift新建一个php 5.4，利用一下.htaccess。&lt;/p></description></item></channel></rss>