本文介绍了.htaccess将多个URL重定向到其相应的新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用.htaccess重定向以下网址:
I'd like to redirect the following urls with .htaccess:
/books/garden 至/garden-books
/movies/dvd-comedy 至/dvd/comedy
/music-soundtracks/new 至/music/soundtracks
/books/garden to /garden-books
/movies/dvd-comedy to /dvd/comedy
/music-soundtracks/new to /music/soundtracks
有人知道该怎么做吗?
推荐答案
如果您想要更简单的解决方案,也可以尝试以下方法:
If you want an even simpler solution you can also try this:
Redirect 301 /books/garden /garden-books
Redirect 301 /movies/dvd-comedy /dvd/comedy
Redirect 301 /music-soundtracks/new /music/soundtracks
旧网址首先位于重定向301"之后,然后是新网址.
The old url is first after "Redirect 301", then the new url.
这篇关于.htaccess将多个URL重定向到其相应的新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!