VPS侦探论坛

 找回密码
 注册
查看: 4655|回复: 2

规则转换后重启还是不起作用

[复制链接]
发表于 2013-4-17 22:16:27 | 显示全部楼层 |阅读模式

规则转换后重启还是不起作用                                                                                                                                                                                                                                                                                                                        阿帕奇的规则
RewriteRule ^single/([a-zA-Z]+_*[0-9]*).html$ single.php\?f=$1
RewriteRule ^like\/([0-9]+)$ like.php\?id=$1
RewriteRule ^topic\/[0-9]+\/([0-9]+_*[0-9]*)\.html$ art.php\?id=$1
RewriteRule ^[a-zA-Z]+\/[a-zA-Z]+([0-9]+)$ topic.php\?id=$1
RewriteRule ^([a-zA-Z]+_*[0-9]*)\.html$ type.php\?id=$1
RewriteRule ^[a-zA-Z]+\/[a-zA-Z]+([0-9]+_*[0-9]*)\.html$ topic_list.php\?id=$1

我转换后的
location / { rewrite ^/single/([a-zA-Z]+_*[0-9]*).html$ /single.php?f=$1;
    rewrite ^/like/([0-9]+)$ /like.php?id=$1;
    rewrite ^/topic/[0-9]+/([0-9]+_*[0-9]*).html$ /art.php?id=$1;
    rewrite ^/[a-zA-Z]+/[a-zA-Z]+([0-9]+)$ /topic.php?id=$1;
    rewrite ^/([a-zA-Z]+_*[0-9]*).html$ /type.php?id=$1;
    rewrite ^/[a-zA-Z]+/[a-zA-Z]+([0-9]+_*[0-9]*).html$ /topic_list.php?id=$1;
    }  
/etc/init.d/nginx start 后 访问依然404 求解
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-4-18 11:07:19 | 显示全部楼层


可能规则还是有问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-4-19 13:05:22 | 显示全部楼层

location / {
        rewrite ^/single/([a-zA-Z]+_*[0-9]*).html$ /single.php?f=$1;
        rewrite ^/like/([0-9]+)$ /like.php?id=$1;
        rewrite ^/[a-zA-Z]+/[a-zA-Z]+/([0-9]+_*[0-9]*).html$ /art.php?id=$1;
        rewrite ^/[a-zA-Z]+/[a-zA-Z]+([0-9]+)$ /topic.php?id=$1;
        rewrite ^/([a-zA-Z]+_*[0-9]*).html$ /type.php?id=$1;
        rewrite ^/[a-zA-Z]+/[a-zA-Z]+([0-9]+_*[0-9]*).html$ /topic_list.php?id=$1;
}
这样就OK了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-24 11:32 , Processed in 0.025191 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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