【问题标题】:Not able to remove # from url [duplicate]无法从 url 中删除 # [重复]
【发布时间】:2019-11-02 13:21:04
【问题描述】:

我尝试从 URL 中删除 # ,例如 http://locohost:8080/app/#/home

尝试使用

$locationProvider.html5Mode({
  enabled: true,
  requireBase: false,
  hasPrefix: ''
});

还在<head> 标签内添加了<base href=""/> in index.html

但是在点击 URL http://locohost:8080/app/home 时,出现 404 错误

【问题讨论】:

标签: angularjs


【解决方案1】:

尝试使用:

str.replace("/#/","/")

【讨论】:

  • 否,上述解决方案不起作用
猜你喜欢
  • 2023-03-09
  • 1970-01-01
  • 1970-01-01
  • 2015-03-23
  • 2013-08-02
  • 1970-01-01
  • 1970-01-01
  • 2021-10-04
  • 2021-09-03
相关资源
最近更新 更多