Remove web / app.php of reference. Symfony2 -



Remove web / app.php of reference. Symfony2 -

all requests go through file web / app.php (similar index.php), such request main page - adwords-up.com/web/app.php, input - adwords-up.com /web/app.php/login. want part of web / app.php removed link. in configuration .htaccess, redirect default web / app.php, request such main form - http://adwords-up.com/, , page login - http://adwords-up.com/login.

there /etc/apache2/sites-available/adwords-up.conf

<virtualhost *:80> # servername directive sets request scheme, hostname , port t$ # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used lastly resort host regardless. # however, must set farther virtual host explicitly. servername adwords-up serveradmin webmaster@localhost documentroot /var/www/adwords-up/web # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined # configuration files conf-available/, # enabled or disabled @ global level, possible # include line 1 particular virtual host. illustration # next line enables cgi configuration host # after has been globally disabled "a2disconf". #include conf-available/serve-cgi-bin.conf </virtualhost>

this might help

<ifmodule mod_rewrite.c> rewriteengine on # determine rewritebase automatically , set environment variable. # if using apache aliases mass virtual hosting or installed # project in subdirectory, base of operations path prepended allow proper # resolution of app.php file , redirect right uri. # work in environments without path prefix well, providing safe, one-size # fits solution. not need in case, can comment # next 2 lines eliminate overhead. rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1] # redirect uri without front end controller prevent duplicate content # (with , without `/app.php`). redirect on initial # rewrite apache , not on subsequent cycles. otherwise # endless redirect loop (request -> rewrite front end controller -> # redirect -> request -> ...). # in case "too many redirects" error or redirected # startpage because apache not expose redirect_status # environment variable, have 2 choices: # - disable feature commenting next 2 lines or # - utilize apache >= 2.3.9 , replace l flags end flags , remove # next rewritecond (best solution) rewritecond %{env:redirect_status} ^$ rewriterule ^app\.php(/(.*)|$) %{env:base}/$2 [r=301,l] # if requested filename exists, serve it. # want allow apache serve files , not directories. rewritecond %{request_filename} -f rewriterule .? - [l] </ifmodule>

add .htaccess , sure have rewriteengine activated mutual question answers on symfon2 doc

symfony2

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -