.htaccess URL 重定向 [英] .htaccess URL redirect
本文介绍了.htaccess URL 重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何重定向http://domain.com/blog/index.php/weblog/rss_2.0/ 到 http://www.domain.com/feed/ 与 .htaccess?
How can I redirect http://domain.com/blog/index.php/weblog/rss_2.0/ to http://www.domain.com/feed/ with .htaccess?
该网站有 3 个域指向它,并且都使用相同的 htaccess.
The website has 3 domains pointing to it and all is using the same htaccess.
谢谢!
推荐答案
您可以使用 mod_rewrite.
You could utilise mod_rewrite.
RewriteEngine On
RewriteRule ^blog/index.php/weblog/rss_2.0/$ /feed/ [R=302]
这应该将 URL 转发到与请求相同的域上的/feed/.一旦您感到满意,您就可以将 302 更改为 301.
That should forward the URL to /feed/ on the same domain as the request came in on. Once you're happy it's working you can change the 302 to 301.
这篇关于.htaccess URL 重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文