url_matcher1.apache 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # skip "real" requests
  2. RewriteCond %{REQUEST_FILENAME} -f
  3. RewriteRule .* - [QSA,L]
  4. # foo
  5. RewriteCond %{REQUEST_URI} ^/foo/(baz|symfony)$
  6. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:foo,E=_ROUTING_bar:%1,E=_ROUTING_def:test]
  7. # bar
  8. RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$
  9. RewriteCond %{REQUEST_METHOD} !^(get|head)$ [NC]
  10. RewriteRule .* - [S=1,E=_ROUTING__allow_get:1,E=_ROUTING__allow_head:1]
  11. RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$
  12. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1]
  13. # baz
  14. RewriteCond %{REQUEST_URI} ^/test/baz$
  15. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz]
  16. # baz2
  17. RewriteCond %{REQUEST_URI} ^/test/baz\.html$
  18. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz2]
  19. # baz3
  20. RewriteCond %{REQUEST_URI} ^/test/baz3$
  21. RewriteRule .* $0/ [QSA,L,R=301]
  22. RewriteCond %{REQUEST_URI} ^/test/baz3/$
  23. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz3]
  24. # baz4
  25. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$
  26. RewriteRule .* $0/ [QSA,L,R=301]
  27. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  28. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz4,E=_ROUTING_foo:%1]
  29. # baz5
  30. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  31. RewriteCond %{REQUEST_METHOD} !^(post)$ [NC]
  32. RewriteRule .* - [S=2,E=_ROUTING__allow_post:1]
  33. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$
  34. RewriteRule .* $0/ [QSA,L,R=301]
  35. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  36. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz5,E=_ROUTING_foo:%1]
  37. # 405 Method Not Allowed
  38. RewriteCond %{_ROUTING__allow_get} !-z [OR]
  39. RewriteCond %{_ROUTING__allow_head} !-z [OR]
  40. RewriteCond %{_ROUTING__allow_post} !-z
  41. RewriteRule .* app.php [QSA,L]