服务器 Gind.cn
  • Linux
  • Windows
  • Ubuntu
  1. 服务器 Gind.cn
  2. 重写 301redirect nginx
  3. nginx从.htmredirect到没有的url
Intereting Posts
Windows DNS Server 2008是否支持RTT? 重置Dell BladeCentre 1855上的DRAC / MC密码 光纤通道环境中KVM / XEN的集群文件系统select iis7表单身份validation丢失? F5包过滤或iRules或两者? Cisco ASA 5520缺lesspipe理界面 Crontab – 停止发送邮件,特殊情况|| 用于IPv6未经请求的邻居广告的Linux工具 “系统”过程突然使用CPU很多 如何找出mod_security是否安装在我的apache服务器上? 免费的antivius是最好的Comodo Antivirus和ClamWin AV 我可以在unix上使用mssql.so和php之前,是否需要安装mssql? 未能满足Debian7的依赖 @在/ usr / lib / systemd / system .service名称文件中的含义 SSO和不受信任网站的身份提供商

nginx从.htmredirect到没有的url

您好新的网站启动。 前网站有这样的url:

http://example.com/something.htm

新网站没有,看起来像这样:

http://example.com/something

  • htaccess取代了完整的URL而不是REQUEST_URI
  • mod_wsgi,.htaccess和rewriterule
  • 如何防止在htaccess无限redirect循环?
  • 删除/文件夹/从WordPress使用国防部重写?
  • 如何在Debian Lenny上将Apache重写为Apache 2.2

我怎么能告诉nginx做这个redirectpermanetly(301)。

我已经尝试rewrite ^(.*)$ $1.htm permanent; 没有成功。

 location ~*\.(htm)${ rewrite ^(.*)$ $1.htm permanent; } 

  • Apache 2.2重写 – 强制所有的请求index.html
  • Nginx的,PATH_INFO,和URL重写:我必须缺less的东西
  • 如何解释这些htaccess重写规则
  • nginx – 如何… DirectoryIndex到一个文件夹
  • 我如何使虚拟主机DirectoryIndex文件出现在url?

重写如下

 rewrite ^(/.*)\.htm(\?.*)?$ $1$2 permanent; 

为了向前兼容您的旧网站,您可以试试这个

 index index.htm; try_files $uri.htm $uri/ $uri =404; 
  • 这个Apache URL重写规则有什么问题?
  • nginx服务404上的备用位置
  • Nginx将旧的PHPurl视为文件
  • 在nginx上清理URL和php扩展
  • VirtualHosts上的Apache RewriteRule不适用于组捕获正则expression式
  • 如何从我的RewriteRule Htaccess规则中排除一个子文件夹?
  • 为IIS推荐一个好的URL重写工具
  • IIS 7 URL重写规则
  • 如何将页面从一个级别的子目录redirect到根目录
  • nginx重写不工作? 它只是忽略它

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