服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx重写文件名为目录
Intereting Posts
LAPS PS模块无法导入 在HP dl380p中结合SSD和硬盘? 简单的全文search服务器 SQLSTATE :一般错误:2006 MySQL服务器已经消失 如何在RHEL7.3机器上设置域名 Azure虚拟机大小A1基本不可用 在bash脚本中,>和> |有什么区别 redirect? 端口转发IPTABLES公共IP sysctl.conf设置的build议,以加强Linux对DDoS攻击? 在使用频繁的文件存储服务器中有关驱动器的问题 Windows 2012 Server和RDP连接限制最简单的设置 Windows Server 2008共享文件夹需要login ASA 5505无法启动设备pipe理器 如何在站点configuration中设置nginx位置以避免“重写或内部redirect周期”错误 POST数据未被接收

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