服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx的重写规则为301redirectfilename.asp到filename.php
Intereting Posts
如何在局域网上从一台电脑SSH到另一台电脑 更新服务器主机名后更改IIS服务器名称 在从apache移动到nginx之后,我无法在Internet Explorer浏览器中查看我的网站,而在Firefox中它看起来不错 在只有已知的PHP软件(或:需要替代的非PHP CMS)系统上的PHP安全性 用HTB在Linux上进行stream量整形:奇怪的结果 VMware WDDMvideo驱动程序在Windows 7 64bit中的分数高于VMware SVGA II驱动程序? ISC-DHCP可以绑定到选项82而不是Mac地址? 如何备份和恢复Riak集群的数据? mdadm raid1数组上的文件损坏(但是没有filesytem损坏) 如何使用脚本将Firefox设置为默认浏览器? WordPress无法写入文件,尽pipe正确的文件权限 dhcp-server有2个子网问题 创build事件源的权限 如何在站点根目录中创build一个子域? 迁移到Server 2008 Std R2后,优雅地删除Exchange 2010和SBS2011

Nginx的重写规则为301redirectfilename.asp到filename.php

我已经把我的文件名从filename.asp更改为filename.php,但现在我想301将所有来到filename.asp的请求redirect到它的等效filename.php

我已经尝试过这些变化,但他们只redirect到主页:

if ($request_uri ~ .*.asp.*) { rewrite ^ http://$host? permanent; #rewrite ^/(.*)$ /$1.php permanent; } 

domain.com/folder/filename.asp 301redirect到domain.com/folder/filename.php

谢谢

  • 将apache重写规则转换为nginx
  • nginx位置重写,但proxy_rewriteclosures
  • nginx重写永久性重写的位置
  • 在WordPress和Cherokee Web Server上使用虚拟域名
  • JBoss的URL重写

  • Nginx:我可以在一个不同的URL上caching一个匹配模式的URL吗?
  • 如何使这个htacess重写规则由于最终参数而停止失败
  • Nginx重写子域的规则
  • Nginx重写Zimbra的规则
  • Nginx – 从深层目录结构中提供静态内容

你不需要if得到.asp文件,它可以纯粹在重写中处理:

 rewrite ^/(.*)\.asp$ http://example.com/$1.php permanent; 
  • URL重写和机架基础path
  • varnish3.0.2重写url的howto
  • Web应用程序的URL重写错误
  • .htaccess – 模拟虚拟主机在目录列表中的父目录的错误链接
  • 最简单的方法来实现Nginx上的多个VHost的URL重写
  • 静态站点dynamic重写循环
  • Lighttpd和OpenCart GET请求与mod_rewrite
  • mediawiki和wordpress MU与Nginx不同
  • 使用几个重写规则.htaccess
  • 如何让nginx重写请求到不同的服务器(在同一个configuration中)?

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