规则转换后重启还是不起作用
规则转换后重启还是不起作用 阿帕奇的规则RewriteRule ^single/(+_**).html$ single.php\?f=$1
RewriteRule ^like\/(+)$ like.php\?id=$1
RewriteRule ^topic\/+\/(+_**)\.html$ art.php\?id=$1
RewriteRule ^+\/+(+)$ topic.php\?id=$1
RewriteRule ^(+_**)\.html$ type.php\?id=$1
RewriteRule ^+\/+(+_**)\.html$ topic_list.php\?id=$1
我转换后的
location / { rewrite ^/single/(+_**).html$ /single.php?f=$1;
rewrite ^/like/(+)$ /like.php?id=$1;
rewrite ^/topic/+/(+_**).html$ /art.php?id=$1;
rewrite ^/+/+(+)$ /topic.php?id=$1;
rewrite ^/(+_**).html$ /type.php?id=$1;
rewrite ^/+/+(+_**).html$ /topic_list.php?id=$1;
}
/etc/init.d/nginx start 后 访问依然404 求解 可能规则还是有问题 location / {
rewrite ^/single/(+_**).html$ /single.php?f=$1;
rewrite ^/like/(+)$ /like.php?id=$1;
rewrite ^/+/+/(+_**).html$ /art.php?id=$1;
rewrite ^/+/+(+)$ /topic.php?id=$1;
rewrite ^/(+_**).html$ /type.php?id=$1;
rewrite ^/+/+(+_**).html$ /topic_list.php?id=$1;
}
这样就OK了
页:
[1]