Ant*_*mov 12 .htaccess angularjs yii2
我有一个集成Angular和Yii2的问题我有2个部分:
问题是,当我在Angular部分复制并粘贴url时,我总是得到404错误.Angular配置是
.config(function($routeProvider, $locationProvider) {
base = '/construct/';
$routeProvider.when(base+':className', {
templateUrl: '/construct/builder',
controller: 'BuilderCtrl',
reloadOnSearch: false
}).otherwise({
templateUrl: '/construct/heroes',
controller: 'HeroesCtrl'
});
$locationProvider.html5Mode(true);
});
Run Code Online (Sandbox Code Playgroud)
那么,我如何在HTML5模式下进行直接链接才能看到正确的页面?像"/ construct/something"这样的路径不起作用.我的htaccess是:
RewriteEngine on
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1455 次 |
| 最近记录: |