首先我會說我是一個新手.htaccess
和redirects
。Angular 2.htaccess
事情是,我有一個角2應用程序完美工作,但在此之前,我正在使用一些.php
文件上傳圖像到我的服務器。但是,我上傳我的.htaccess
解決路線問題後。那些.php
不再工作。
這是我目前的.htaccess
文件。
<IfModule mod_rewrite.c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Credentials true
Options Indexes FollowSymLinks
RewriteEngine On
RewriteBase /home/
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(upload|upload_cover)\.php
RewriteRule . /index.html [L]
</IfModule>
我不是能夠找到一個解決辦法:(。
樹
/
-.htaccess
-images/
--content/
-upload.php
-main.bundle.js
-inline.bundle.js
-index.html
-main/
你還可以請求'upload.php'(通過手動發出POST/GET請求)而不用重定向反恐執行局?究竟是什麼*「那些.php不再工作了。」*是什麼意思? – dfsq
@dfsq這意味着,當我把這個URL'http:// www.mypage.com/upload.php',瀏覽器給我這個錯誤**不能匹配任何路線。 URL段:'upload.php'** 在上傳'.htaccess'來解決路由問題之前,這個工作非常完美。 – dreezyA
你能解釋一下哪些路徑應該被重定向到'/ index.html'嗎?除'/ upload.php'和'/upload_cover.php?' – Thakkie