http status code 404 - Symfony: 404 error on production -


here's example of page works fine on dev env , returns 404 error on prod env

not found

the requested url /app/reporter/ not found on server. apache/2.4.7 (ubuntu) server @ symfony.dev port 80

don't let confuse /app/ route, in real route , has nothing app.php

running php app/console router:debug --env=prod confirm there's no problem router :

[router] current routes name                                               method scheme host   path       reporter                                                  /app/reporter/       

of course, before posting message, :

  • cleared cache, console cache:clear --env=prod, directly deleting cache files didnt change anything.
  • double-checked mod_rewrite on in phpinfo

anyway, guess error comes more apache here's conf:

<virtualhost *:80>     serveradmin webmaster@localhost     servername symfony.dev     setenv symfony__tenant__id "123"      documentroot /var/www/html/symfony/web  #               <directory /> #                       options followsymlinks #                       allowoverride none #               </directory>              <directory /var/www/html/symfony/web >                     options indexes followsymlinks multiviews                     allowoverride                     order allow,deny                     allow             </directory>      scriptalias /cgi-bin/ /usr/lib/cgi-bin/             <directory "/usr/lib/cgi-bin">                     allowoverride none                     options +execcgi -multiviews +symlinksifownermatch                     order allow,deny                     allow             </directory>      errorlog ${apache_log_dir}/error-symfony.log      loglevel warn      customlog ${apache_log_dir}/access-symfony.log combined      alias /doc/ "/usr/share/doc/"              <directory "/usr/share/doc/">                     options indexes multiviews followsymlinks                     allowoverride none                     order deny,allow                     deny                     allow 127.0.0.0/255.0.0.0 ::1/128             </directory>  </virtualhost> 

in /var/www/html/, there's symlink:

lrwxrwxrwx 1 root root    29 mai   13  2014 symfony -> /home/me/path/to/symfony 

and didnt change in default symfony /web/.htaccess : without comments readability's sake

directoryindex app.php  <ifmodule mod_rewrite.c> rewriteengine on   rewritecond %{request_uri}::$1 ^(/.+)/(.*)::\2$ rewriterule ^(.*) - [e=base:%1]   rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}]   rewritecond %{env:redirect_status} ^$ rewriterule ^app\.php(/(.*)|$) %{env:base}/$2 [r=301,l]   rewritecond %{request_filename} -f rewriterule .? - [l]   rewriterule .? %{env:base}/app.php [l] </ifmodule>  <ifmodule !mod_rewrite.c> <ifmodule mod_alias.c>      redirectmatch 302 ^/$ /app.php/  </ifmodule> </ifmodule> 

apache error log confirmed error came there :

[negotiation:error] [pid 1583] [client 127.0.0.1:44590] ah00687: negotiation: discovered file(s) matching request: /var/www/html/symfony/web/app (none negotiated). 

as understanding of apache limited, google error , found topic : http://www.bennadel.com/blog/2218-negotiation-discovered-file-s-matching-request-none-could-be-negotiated.htm

so ended simply removing multiviews option of vhost conf , solved it.

as above give link mentionning,

this goes show how bad enable settings when not sure do.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -