0
我遵循了概述的步驟here。 我將以下代碼複製並粘貼到.htaccess文件中。 .htaccess文件位於包含我要在apache上部署的dist文件夾的同一個存儲庫中。apache服務器上的角度部署
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
當我訪問localhost/dist
一切順利,因爲它會用我的index.html文件,它會自動重定向到localhost/dist/login
。現在,如果我直接請求localhost/dist/login
,apache抱怨並顯示The requested URL /dist/login was not found on this server.
在我看來,apache並沒有拿起我的.htaccess
設置。有什麼我做錯了嗎?