php - Dynamic Virtual Host gives 500 error with Laravel -
i'm trying make dynamic developing environment virtual host. have:
<virtualhost *:80> usecanonicalname off virtualdocumentroot "c:\xampp\htdocs\%1\public" # available aliases use serveralias *.dev </virtualhost>
and works default route of laravel:
route::get('/', function () { return view('home.index'); });
but other route give me 500 error of many internal redirects. use laravel 5.2 without changes @ except routes.php , default changes.
when assign domain virtualhost works fine:
<virtualhost *:80> servername example.dev virtualdocumentroot none documentroot "c:\xampp\htdocs\example\public" </virtualhost>
how can fix problem can use dynamic domain names don't have add domains manually.
thank in advance, stefan fransen
edit
when use this:
http://example.dev/index.php/test
the page loading correctly not want. how remove index.php url? i've checked , al modules loaded correctly .htaccess:
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] # # handle authorization header rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] </ifmodule>
edit
found out when changed rewriterule ^ index.php [l]
rewriterule ^(.*)$ /index.php/$1 [l]
but still don't understand why work on manual added vhost not on dynamically generated vhost, have explanation that?
i guess rewrite module (mod_rewrite) disabled. check in apache.conf
maybe section pretty urls can you. https://laravel.com/docs/5.1
Comments
Post a Comment