mentormate-man0l/bench/master/web/.htaccess - Htaccess File

mentormate-man0l/bench/master/web/.htaccess

<IfModule mod_rewrite.c>

RewriteEngine On

#skip "real" requests
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .* - [QSA,L]

# bench_test_default_index
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:bench_test_default_index,E=_ROUTING_default__controller:Bench\TestBundle\Controller\DefaultController::indexAction]

# money
RewriteCond %{REQUEST_URI} ^/money/$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=2,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/money$
RewriteRule .* $0/ [QSA,L,R=301]
RewriteCond %{REQUEST_URI} ^/money/$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:money,E=_ROUTING_default__controller:Bench\TestBundle\Controller\MoneyController::indexAction]

# money_show
RewriteCond %{REQUEST_URI} ^/money/([^/]++)$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/money/([^/]++)$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:money_show,E=_ROUTING_param_id:%1,E=_ROUTING_default__controller:Bench\TestBundle\Controller\MoneyController::showAction]

# user
RewriteCond %{REQUEST_URI} ^/user/$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=2,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/user$
RewriteRule .* $0/ [QSA,L,R=301]
RewriteCond %{REQUEST_URI} ^/user/$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:user,E=_ROUTING_default__controller:Bench\TestBundle\Controller\UserController::indexAction]

# usermoney
RewriteCond %{REQUEST_URI} ^/user/money$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/user/money$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:usermoney,E=_ROUTING_default__controller:Bench\TestBundle\Controller\UserController::moneyAction]

# usermoney2
RewriteCond %{REQUEST_URI} ^/user/money2$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/user/money2$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:usermoney2,E=_ROUTING_default__controller:Bench\TestBundle\Controller\UserController::money2Action]

# user_show
RewriteCond %{REQUEST_URI} ^/user/([^/]++)$
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC]
RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1]
RewriteCond %{REQUEST_URI} ^/user/([^/]++)$
RewriteRule .* app.php [QSA,L,E=_ROUTING_route:user_show,E=_ROUTING_param_id:%1,E=_ROUTING_default__controller:Bench\TestBundle\Controller\UserController::showAction]

# 405 Method Not Allowed
RewriteCond %{ENV:_ROUTING__allow_GET} =1 [OR]
RewriteCond %{ENV:_ROUTING__allow_HEAD} =1
RewriteRule .* app.php [QSA,L]

</IfModule>

On Github License

Files

Download PDF of Htaccess file
_ROUTING__allow_GET, _ROUTING__allow_HEAD, ENV, GET, REQUEST_FILENAME, REQUEST_METHOD, REQUEST_URI

Comments

Apache