服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx的重写规则为301redirectfilename.asp到filename.php
Intereting Posts
服务器的主机名是否真的很重要? 错误ocuuring :::未能安装tomcat 7服务 是否可以使用Microsoft的“安全连接规则”(IPSec)与VPN? 使用curl与cookies lighttpdredirect某些链接到某些url 如何设置RAID 1而不会丢失我的Windows安装? Sharepoint文件共享不工作 只允许在特定的接口上访问Tomcat 6pipe理器 nginx上的域根无法正常工作 为什么在CentOS 7 \ RHEL 7中CD / DVD主机直通function被禁用? 专用的路由器/防火墙vs Linux的iptables / Shorewall 为什么Apache尽pipe看起来正确的configuration,从NFS服务陈旧的文件? Exim 4.69由于语法上无效的EHLO(奇怪的伪MAC FQDN)而拒绝出站邮件, squid3 access.log TCP_DENIED 防火墙拒绝UDP“连接”?

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