The purpose of link_to is to generate routed external urls, unless the file in question is generated by a module/action you shouldnt use the link_to function.
Arian Hojat wrote: > > i noticed my link_to() didnt work on prod server, but on my virtual > hosted dev server, links are fine. symfony is installed in a directory > on prod. So user goes to www1.site.com/projectname/app1_dev.php > <http://www1.site.com/projectname/app1_dev.php> to access app but urls > become on this server like www1.site.com/projectname/app1_dev.php > <http://www1.site.com/projectname/app1_dev.php> > > > my symfony site is installed in a directory so users access via > http://www1.mysite.com/symfonyapps/web/app1_dev.php for example... > So link_to's to other actions usually turn out well, and form correctly > like: > http://www1.mysite.com/symfonyapps/web/app1_dev.php/viewmodule1/12 > but this won;t work: > return link_to('Download File', $this->getFileName()); > it returns something like: > http://www1.mysite.com/symfonyapps/web/app1_dev.php/files/blah.xls > which returns a 404 not found response. > > I resorted to this: > return '<a href="/symfonyapps/web/' . $this->getFileName() . '>Download > File</a>'; > but would like some ideas on how to get past above problem... I cant > move the symfony install, company would like to access that way. Maybe > there is an apache web alias that files need when using link_to since > they are in a special directory (Im thinking the /sf alias's i set up on > my virtual host, but i dunno if thats whats needed in my case to solve > problem)? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
