VPS侦探论坛

 找回密码
 注册
查看: 5132|回复: 1

apache和nginx的rewrite转换问题

[复制链接]
发表于 2014-6-3 10:42:39 | 显示全部楼层 |阅读模式

以前apache的.htaccess文件
  1. RewriteEngine on

  2. RewriteCond %{REQUEST_METHOD} ^TRACE
  3. RewriteRule .* - [F]

  4. RewriteCond %{HTTP_HOST} !^www.ewdai.com$ [NC]

  5. RewriteRule ^(.*)$ http://www.ewdai.com/$1 [L,R=301]

  6. SetOutputFilter DEFLATE

  7. AddOutputFilterByType DEFLATE text/html text/css image/gif image/jpeg image/png application/x-javascript

  8. php_value memory_limit 512M
  9. php_flag display_startup_errors off
  10. php_flag display_errors off
  11. php_flag html_errors off
  12. php_value docref_root 0
  13. php_value docref_ext 0

  14. RewriteRule .(php.|php3.) index.php
  15. RewriteRule update/$ – [F]
  16. RewriteRule data/$ – [F]
  17. RewriteRule themes/$ –[F]
  18. RewriteRule update/(.*).php$ – [F]
  19. RewriteRule data/(.*).php$ – [F]
  20. RewriteRule themes/(.*).php$ –[F]

  21. RewriteRule (.*)/index.html$ index.php?$1
  22. RewriteRule (.*)/index(\d+).html$ index.php?$1&page=$2
  23. RewriteRule (.*)/a(\d+)\.html$ index.php?$1/$2
  24. RewriteRule ^u/(\d+)/(.*)$ index.php?u&$1&$2
  25. RewriteRule ^u/(\d+)/(.*)/$ index.php?u&$1&$2
  26. RewriteRule ^u/(\d+)$ index.php?u&$1
  27. RewriteRule ^u/(\d+)/$ index.php?u&$1
  28. RewriteRule (.*)/index.html\?(.*) index.php?$1&$2
  29. RewriteRule (.*)/index(\d+).html\?(.*) index.php?$1&page=$2&$2
复制代码
现在换成了NGNIX以后rewrite该怎么写,有知道的朋友帮下忙,谢谢了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-6-3 15:10:34 | 显示全部楼层
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 19:19 , Processed in 0.025582 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表