服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx的重写规则为301redirectfilename.asp到filename.php
Intereting Posts
你怎么能告诉ssh密钥是多less年? 如何在OSPF中使用Cisco IOS向IPSec隧道发布路由 Apache 2.2,多个PHP版本,mod_fcgid:获取重叠错误OS 109 服务器到服务器(Linux)VPN最佳实践? postfix sasl / tls用户名密码ubuntu14.04只发送 拆分命令等效/replace,总计件/部件? 主pipe总是退出进程'退出状态0; 没有预料到' 备份系统,两个地点。 build议? 使用Powershell设置GPO计算机configuration KVM – 从PXE安装的优点 将所有(未被拒绝的)垃圾邮件redirect到sa-exim中的特殊邮箱 NGinx和PHP应该运行什么用户? 如何检查端口5060是否在centos中打开? 在机器之间移动快照 防止服务器在自动更新后重新启动

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