【发布时间】:2023-03-07 03:11:01
【问题描述】:
我就是不明白:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteRule ^([a-z]+\-[0-9]+)/?$ $1/home/ [R]
RewriteRule ^[a-z]+\-([0-9]+)/(home|alone)/?$ /$2.php?id=$1 [L]
RewriteRule ^.*$ http://www.anotherdomain.com/ [R=301]
为什么总是处理最后一条规则(最后是指重定向到 anotherdomain.com)?
我需要这样的东西:
http://mydomain.com/some-344 ---> http://mydomain.com/some-344/home/
http://mydomain.com/some-344/ ---> http://mydomain.com/some-344/home/
http://mydomain.com/some-344/home/ ---> home.php?id=344
http://mydomain.com/some-344/alone/ ---> alone.php?id=344
http://mydomain.com/anythingelse... --> http://www.anotherdomain.com/
谢谢!
【问题讨论】:
标签: mod-rewrite