【发布时间】:2016-06-27 04:17:54
【问题描述】:
我知道这个问题已经在堆栈溢出中被问过很多次了,但我无法得到正确的结果。
我试过这个链接:htaccess redirect for Angular routes
所以基本上,我在我的应用中使用https://github.com/angular-ui/ui-router 进行导航,
我们有一个这样的网址:
www.xyz.com/products 工作正常,(硬刷新时工作正常)
www.xyz.com/displayOrders/12 为什么?
我的嵌套视图也不起作用:
- www.xyz.com/message/notfication/12
我在 .htaccess 文件中写的是:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule (.*) index.html [L]
</IfModule>
我的基本标签是这样的:
<base href="/"> and i also made html5mode as true in app.js
【问题讨论】:
标签: php angularjs regex apache mod-rewrite