服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx重写文件名为目录
Intereting Posts
使用可以将用户的公钥添加到一个用户的authorized_keys文件 代理服务器核心的更新 – 帮助 在Docker中捕获audio 301从非wwwredirect到www问题 如何更改Sharepoint端口 将openfire内存增加到更大的值 tomcat负载平衡的问题 Mikrotik dst-nat超时 如何开发应用程序以便于部署? 你可以让MS Sql服务器拒绝所有匹配的特定模式的查询? 网站无法访问,而ping的作品? 构build具有持久存储的Docker Swarm 如何在ESXi虚拟机中运行VMWare Server虚拟机? 修复数据库中不一致的页面 连接超时ftp无法连接

Nginx重写文件名为目录

我想重写一个文件名membership-list.html作为根域上的一个目录作为membership-list/ 。 我在我的configuration文件中有这个:

 location = ^/membership-list.html { rewrite ^/membership-list.html ^/membership-list/ redirect; } 

我周围search,找不到任何有关从文件redirect到目录名称的信息。

  • Nginx的子域名和重写规则
  • IIS7 URL重写模块:强制为root
  • 用多个参数使用.htaccess重写URL
  • nginx 0.7.65重写不能用于双斜杠?
  • IIS7模块:在function视图中不显示?

把它放在位置块和服务器块内部。

 rewrite ^/membership-list.html /membership/; 

然后用你需要的任何东西创build位置:

 location /membership/ { } 

https://www.nginx.com/blog/creating-nginx-rewrite-rules/

http://www.imrantariq.com/blog/regular-expression-caret-or-circumflex-in-character-class/

  • 如何将URL重写和fastcgi结合在nginx中?
  • 是否有可能更改在IIS7的URL重写,而无需重新启动应用程序?
  • nginx user_agentredirect
  • 如何使用Apache从子文件夹代理到其他服务器
  • NGINX:301重写
  • 如何在使用Nginx重写的Zend Framework路由中避免index.php
  • nginx重写不包括.php文件?
  • 用mod_rewrite强制SSL
  • 用.htaccess保护目录
  • Nginx重写redirect/到一个目录

  • © 2017 服务器 Gind.cn
  • Topics
  •        
  • Powered by Server
  • Privacy Policy