漂亮的URL路由问题

时间:2016-01-30 14:37:00

标签: javascript css angularjs .htaccess

我在角度js中的漂亮网址路由有问题。我修复了漂亮的url问题,使html5mode为true并更改了基本href。 例如:

基础href:

访问角度网站

主要网址:http://localhost/creatcod/cod_angular/

导航到服务时,它可以正常工作。

服务网址:http://localhost/creatcod/cod_angular/services/

但是当我进入其服务详细信息页面时

详情服务网址:http://localhost/creatcod/cod_angular/services/5

问题出现了:(

资源解释为样式表,但使用MIME类型text / html进行传输: http://localhost/createcod/cod_angular/services/bower_components/bootstrap/dist/css/bootstrap.css

问题是通过添加服务来更改基本网址。因此,找不到bootstrap css文件并创建此问题

的.htaccess

RewriteEngine On  
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /createcod/cod_angular/index.html

任何帮助都会很棒:)

0 个答案:

没有答案