如何配置 .htaccess 以访问项目中的子目录 angularjs

How to configure .htaccess to get access sub directories in a project angularjs

请您帮忙设置.htaccess 以正常获取访问子目录。

我的.htaccess配置如下:

# htaccess pushstate html5
<ifModule mod_rewrite.c>
RewriteEngine on
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
# Rewrite everything else to index.html to allow html5 state links
RewriteRule ^ index.html [L]
</ifModule>

我可以顺利访问目录www.domain.com/nature。但是,当访问时:www.domain.com/nature/ocean 页面损坏(仅出现文本、视频、图像,但没有结构化。似乎没有加载 css。)我会设置 .htaccess 以获得访问权限这些子目录。

.htaccess 没有问题,只是 css link。

内容如下:<link rel="stylesheet" href="styles/main.css">

我这样输入:<link rel="stylesheet" href="../styles/main.css"> 并且有效。