全球主机交流论坛

标题: 求转个htaccess伪静态规则到nginx [打印本页]

作者: cuxian    时间: 2010-12-7 16:12
标题: 求转个htaccess伪静态规则到nginx
直接在线转换的那种不用了,试过了行不通。就是不明白上面的两句rewritecond怎么个弄法。寻求帮助,谢谢!
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)faq/(.*).shtml$ $1/faq\.php\?id=$2

RewriteRule ^(.*)questions/(.*).shtml$ $1/questions\.php\?id=$2

作者: 小夜    时间: 2010-12-7 16:14
找我啊。。。。
  1. location / {
  2.             rewrite ^/faq/(.+).shtml$ /faq.php?id=$1 last;
  3.             rewrite ^/questions/(.+).shtml$ /questions.php?id=$1 last;
  4. }
复制代码

[ 本帖最后由 小夜 于 2010-12-7 16:23 编辑 ]
作者: cuxian    时间: 2010-12-7 16:15
看你忙碌状态,没敢打扰你老人家  
作者: 小夜    时间: 2010-12-7 16:18
在陪领导开会呢,我拿本子,假装记录会议记录,其实是在看小说。
作者: cuxian    时间: 2010-12-7 16:18
原帖由 小夜 于 2010-12-7 16:14 发表
找我啊。。。。location / {
if (!-e $request_filename){
            rewrite ^/faq/(.+)$.shtml /faq.php?id=$1 last;
            rewrite ^/questions/(.+)$.shtml /questions.php?id=$1 last;
        }
} ...

不行,还是404
作者: 菠萝    时间: 2010-12-7 16:19
小夜还是上班族呢啊,我还以为是全职站长呢
作者: 小夜    时间: 2010-12-7 16:25
已解决,版主锁贴,沉底。
作者: cuxian    时间: 2010-12-7 16:31
小夜胸低给解决了  
作者: Globalization    时间: 2010-12-7 16:34
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/

下次你自己转换




欢迎光临 全球主机交流论坛 (https://loc.193.gs/) Powered by Discuz! X3.4