douhuan3448 2015-09-05 08:47
浏览 49

使用Angular-UI在HTTP上提供laravel

I am trying to serve Laravel 4 routes using Angular-UI over HTTPs. Without HTTPs it works but over the same it brings a 404 error.

Thanks for any assistance.

htaccess file:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Route:

Route::get('index', array('as'=>'index','uses'=>'PagesController@getIndex'));

Angular-UI

state('home', {
            url: '/home',
            templateUrl: 'index'
        })
  • 写回答

1条回答 默认 最新

  • duanpa2143 2015-09-07 11:11
    关注

    I have found a solution to it, I hope this helps someone. On linux do the following:

    sudo leafpad etc/apache2/sites-available/default-ssl

    Then on that file edit the following line AllowOverride None in

    <Directory />
            Options FollowSymLinks
            AllowOverride None
        </Directory>
        <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>
    

    To:

    AllowOverride all
    

    Thank you all.

    评论

报告相同问题?