0
我在我的PC中使用Apache服务器。我在angularJS应用程序中阅读了一些关于从URL中删除#号的教程。 Apache服务器将指令的所有文件替换为index.html。虽然文件名称相同,但它的内容替换为index.html文件内容。请帮助我。我添加一些代码到C:\ XAMPP的\ apache的\的conf \ httpd.conf中从Apache服务器的angularJS应用中的URL中删除#号
# <VirtualHost> definition. These values also provide defaults for
<VirtualHost *:8000>
ServerName localhost
DocumentRoot "C:/xampp/htdocs/googleSignin/"
<Directory "C:/xampp/htdocs/googleSignin/">
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^/index.html
</Directory>
</VirtualHost>
# any <VirtualHost> containers you may define later in the file.
直视图angular.min.js文件更改为index.html的
谢谢您的回答。但我已经将Html5Mode设置为true ...我的问题是不同的。为什么所有文件内容都改为index.html文件。见上图。 – Sandeep
在上面的截图中,是否加载了'appjs.js'的内容,或者它是否也是'index.html'? *永远不会发现*我看到它的请求产生的错误。 – bbrown