开发者

Multiple mappings in .htaccess files don't work

开发者 https://www.devze.com 2023-02-14 18:05 出处:网络
I have this mapping in my .htaccess file RewriteRule outdoors/trees/(.*)/(.*) o开发者_高级运维utdoors/trees/tree.php?tree_id=$1

I have this mapping in my .htaccess file

RewriteRule outdoors/trees/(.*)/(.*) o开发者_高级运维utdoors/trees/tree.php?tree_id=$1
RewriteRule outdoors/parks/(.*)/(.*) outdoors/parks/park.php?tree_id=$1

For some reason the mapping to the trees works, but the one to the parks does not. What I am trying to do is have a url like this: http://www.comehike.com/outdoors/parks/park.php?park_id=1

to redirect to one that looks like this: http://www.comehike.com/outdoors/parks/3/ParkName

Any idea why that isn't working with the redirects I showed above?

Thanks, Alex


The LAST flag may work.

RewriteRule outdoors/trees/(.*)/(.*) outdoors/trees/tree.php?tree_id=$1 [L]
RewriteRule outdoors/parks/(.*)/(.*) outdoors/parks/park.php?tree_id=$1 [L]

EDIT: Typo in park_id

RewriteRule outdoors/trees/(.*)/(.*) outdoors/trees/tree.php?tree_id=$1 [L]
RewriteRule outdoors/parks/(.*)/(.*) outdoors/parks/park.php?park_id=$1 [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消