最佳实践重定向到“正在建设中”删除旧网站后的页面
我被要求删除一个网站,因此在创建新网站时删除了文件并放置了一个带有“正在建设”消息的新索引页面。该网站的旧页面仍然显示在 Google 中,但现在解决了 403-Forbidden 问题。
我希望这些重定向到正在建设的页面。这可能会持续几周,届时我将希望将这些页面永久重定向 (301) 到新网站上的相应页面。
有没有一个简单的技巧(.htaccess)可以让我实现这一点?我想要 303 重定向吗?
任何帮助将不胜感激
编辑
非常感谢您的答案,直到现在我才意识到这不是 Apache 服务器,因此 htacess 将无法工作。不过,答案中的代码将来肯定会派上用场。我会四处寻找解决方案,如果我遇到困难,我会问另一个问题。
I have been asked to take down a website, and as such have removed the files and placed a new index page with a 'under construction' message while the new site is being created. Old pages from the site still show up in google, but now resolve 403-Forbidden.
I want these to redirect to the under construction page. This will likely be in effect for a few weeks, at which point I will want to permanently redirect (301) those pages to cooresponding pages on the new site.
Is there an easy trick (.htaccess) to make this happen for me? Do I want a 303 redirect?
Any help would be greatly appreciated
EDIT
well thanks for the answers, I didn't realize until now that this is not an Apache server so htacess will not work. The code in the answers will definitely come in handy in the future however. I'm gonna poke around a bit to look for a solution and will ask another question if I'm stumped.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个,重定向到index.php;
Try this, redirects to index.php;
将其放入
.htaccess
文件中,将index.php
替换为需要重定向到的文件。Put this in your
.htaccess
file, replacingindex.php
by the file it needs to redirect to.