【发布时间】:2012-03-07 20:45:27
【问题描述】:
我的问题是:当 URL 包含像 goo.gl 和 bit.ly 这样的“+”时,如何重定向 URL
一个简单的例子
http://goo.gl/gogl+ 会被重定向到http://goo.gl/info/gogl
提前致谢。
【问题讨论】:
标签: .htaccess redirect rewrite bit.ly goo.gl
我的问题是:当 URL 包含像 goo.gl 和 bit.ly 这样的“+”时,如何重定向 URL
一个简单的例子
http://goo.gl/gogl+ 会被重定向到http://goo.gl/info/gogl
提前致谢。
【问题讨论】:
标签: .htaccess redirect rewrite bit.ly goo.gl
您只需要 .htaccess 文件中的这段代码:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^([^\+]+)\+$ info/$1 [L]
【讨论】:
[L,R=301] 是正确的。