服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx重写文件名为目录
Intereting Posts
如果计算机是Windows 2003域的一部分,是否应启用Windows 7本地pipe理员configuration文件? 防火墙和QoS与iptables返回 与更多类似的进程配对时,进程CPU%会翻倍 多个.dat文件 – 可能使用VMWare ThinApp? 是否有可能让ntpdate在代理之后工作? 如何在未安装Exchange的SMTP Windows Server 2003上移动Inetpub \ mailroot文件夹 ytalk – 如何使它显示在列而不是行? Debian挤压KVM – 无论如何我设置桥梁,在客人没有连通性 我怎样才能防止警告没有xauth数据; 使用假身份validation数据进行X11转发? github工作需要什么无阻塞的端口? DNSSEC +绑定:dnskey被tld无效 嵌套的Drupal网站清理url 批量交换uidNumber / gidNumber? Apache 2.0与Apache 2.2和PHP – 我需要了解什么区别? 如何从浏览器(ISPConfig)无法mail.example.com?

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