angularjs - Angular and Laravel Apache / htaccess Rules -
i deploying angular , laravel application on apache2 / ubuntu 14.
i having issues rewrites make work ok.
the angular application redirected index needs call laravel api routes.
i using laravel few api routes
i using angular ui router in html5 mode.
i have set laravel application render:
route::get('/', function () { return file::get(public_path().'\index.html'); });
in apache or htaccess
should render angular html file or render index.php renders angular html file?
my angular htaccess file options -multiviews
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}]
my apache virtual host file is:
allowoverride rewriteengine on rewritebase /var/www/website/public/ # rewritecond %{request_uri} ^(/index\.php|/img|/js|/css|/robots\.txt|/favicon\.ico) # rewritecond %{request_filename} !-f # rewritecond %{request_filename} !-d # rewriterule ./index.html [l] # rewritecond %{request_filename} !-d # rewritecond %{request_filename} !-f # rewriterule ^ index.php [l] # # don't rewrite files or directories # rewritecond %{request_filename} -f [or] # rewritecond %{request_filename} -d # rewriterule ^ - [l] # # # rewrite else index.html allow html5 state links rewriterule ^ index.html [l]
i trying few options this.
i have various api routes angular app calls on laravel, start /api , exclude these angular app redirection using ui state ref
any ideas guys?
also should using server vhosts instead of htaccess file slower?
thanks guys :) first time poster :)
Comments
Post a Comment