服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 nginx
  3. Nginx的重写规则为301redirectfilename.asp到filename.php
Intereting Posts
KVM客人拍摄快照后中断 问题与Nginx SSLconfiguration301 http到https 有没有办法将MS SQL .db.back(数据库备份)导入PostgreSQL? 基于Windows组成员身份和vlan位置访问SQL Server 访问连接到本地无线networking的本地设备上托pipe的网站时遇到问题 如何在具有2.5“SFF SAS的HP ProLiant ML350 G6上实施便宜的LFF 3.5”SATA存储 在Debian上使用Apache HTTP ServerconfigurationTomcat7 有没有一种方法来编程更新DNSlogging? 如何在配方运行时使用厨师的ifconfig资源configurationnetworking接口 数据中心库存pipe理 nginx – linux权限有趣的问题 如何查看专用服务器上的init脚本输出? Ubuntu 10.04:启动时检查磁盘需要很长时间 将Active Directory从2000升级到2008 定期备份一个MySQL数据库

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