我有一个600个url的列表。 由于系统的变化,url会变成新的格式。 我会列出旧的url和相应的新url。 但是,我如何301redirect所有这些?
例:
/news/post-name -> /news/post-name.html /wordpress/στα-ελληνικά -> /wordpress/sta-ellinika.html (in greek) /cms/a-big-long-title-with-a-lot-of-te -> /cms/a-big-long-title-with-a-lot-of-text.html
没有可以使工作自动化的真正模式。
那么redirect所有这些方法的正确方法是什么?
您可以使用地图模块来简化nginxconfiguration,但是您将不得不编写一个脚本来将您的URL列表转换为正确的nginx格式。 我会build议生成map指令到一个单独的文件,然后包含在主configuration中。