url_matcher1.apache 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_DEFAULTS_def:test]
  7. # foobar
  8. RewriteCond %{REQUEST_URI} ^/foo(?:/([^/]+?))?$
  9. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:foobar,E=_ROUTING_bar:%1,E=_ROUTING_DEFAULTS_bar:toto]
  10. # bar
  11. RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$
  12. RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
  13. RewriteRule .* - [S=1,E=_ROUTING__allow_GET:1,E=_ROUTING__allow_HEAD:1]
  14. RewriteCond %{REQUEST_URI} ^/bar/([^/]+?)$
  15. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1]
  16. # baragain
  17. RewriteCond %{REQUEST_URI} ^/baragain/([^/]+?)$
  18. RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$ [NC]
  19. RewriteRule .* - [S=1,E=_ROUTING__allow_GET:1,E=_ROUTING__allow_POST:1,E=_ROUTING__allow_HEAD:1]
  20. RewriteCond %{REQUEST_URI} ^/baragain/([^/]+?)$
  21. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baragain,E=_ROUTING_foo:%1]
  22. # baz
  23. RewriteCond %{REQUEST_URI} ^/test/baz$
  24. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz]
  25. # baz2
  26. RewriteCond %{REQUEST_URI} ^/test/baz\.html$
  27. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz2]
  28. # baz3
  29. RewriteCond %{REQUEST_URI} ^/test/baz3$
  30. RewriteRule .* $0/ [QSA,L,R=301]
  31. RewriteCond %{REQUEST_URI} ^/test/baz3/$
  32. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz3]
  33. # baz4
  34. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$
  35. RewriteRule .* $0/ [QSA,L,R=301]
  36. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  37. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz4,E=_ROUTING_foo:%1]
  38. # baz5
  39. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  40. RewriteCond %{REQUEST_METHOD} !^(POST)$ [NC]
  41. RewriteRule .* - [S=2,E=_ROUTING__allow_POST:1]
  42. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)$
  43. RewriteRule .* $0/ [QSA,L,R=301]
  44. RewriteCond %{REQUEST_URI} ^/test/([^/]+?)/$
  45. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz5,E=_ROUTING_foo:%1]
  46. # baz6
  47. RewriteCond %{REQUEST_URI} ^/test/baz$
  48. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz6,E=_ROUTING_DEFAULTS_foo:bar\ baz]
  49. # baz7
  50. RewriteCond %{REQUEST_URI} ^/te\ st/baz$
  51. RewriteRule .* app.php [QSA,L,E=_ROUTING__route:baz7]
  52. # 405 Method Not Allowed
  53. RewriteCond %{_ROUTING__allow_GET} !-z [OR]
  54. RewriteCond %{_ROUTING__allow_HEAD} !-z [OR]
  55. RewriteCond %{_ROUTING__allow_POST} !-z
  56. RewriteRule .* app.php [QSA,L]