I want to remove "web" in URL. For example, I request such as the bottom URL.
http://localhost/symfony/web/mypage
But, I want to request such as the bottom URL.
http://localhost/symfony/mypage
So, I create .htaccess in document root and write settings.
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^symfony/(.*)$ symfony/web/$1 [L]
</IfModule>
And I got 404 error. This error messges appear in app/log/prod.log.
[2015-04-27 15:19:09] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /symfony/mypage/"" at /home/foobar/public_html/symfony/app/cache/prod/classes.php line 1885 {"exception":"[object] (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code: 0): No route found for \"GET /symfony/mypage/\" at /home/foobar/public_html/symfony/app/cache/prod/classes.php:1885, Symfony\Component\Routing\Exception\ResourceNotFoundException(code: 0): at /home/foobar/public_html/symfony/app/cache/prod/appProdUrlMatcher.php:781)"} []
How to remove "web" in url on Symfony2 ?
webtosymfony.