Apacheredirect到AngularJs的index.html
我正在构build和部署我的AngularJs应用程序。 文件夹结构如下: / /path /path/to /path/to/install /path/to/install/index.html /path/to/install/js /path/to/install/css … 我想将所有请求redirect到/path/to/install/index.html,除了请求文件存在。 最初我把我的应用程序放在/ dev中,我的.htaccess放在/ dev里面是: Options +FollowSymLinks IndexIgnore */* RewriteEngine on ErrorDocument 404 /dev/index.html # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteCond %{REQUEST_URI} !/api RewriteRule ^.*$ – [NC,L] # otherwise forward […]