在Angular SPA中,我安装了deeplinks。您也可以从应用程序跳转到它们,但是如果我直接在浏览器中输入url,我会得到一个404错误。我知道Angular只构建虚拟路由,而这些路由并不实际位于ApacheServer上。
具体地说,以下路由:
<domain>/app/hamburg/energy该应用程序位于文件夹"app“中。
我在根目录中使用以下RewriteRule。
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我需要的应用程序的搜索引擎优化的深度链接。有人能帮我解释一下如何通过链接直接跳转到应用程序的子页面吗?
致以最多的问候和感谢。
萨沙
发布于 2020-12-03 16:50:15
试试这个:
# To be inside the /Directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>https://stackoverflow.com/questions/65122138
复制相似问题