【发布时间】:2017-11-02 13:15:37
【问题描述】:
我有这个文件夹结构
--laravel
----public
------index.php
------uploads
--------image.jpg
--angular
----dist
------index.html
我想要三样东西
1) http(s)://www.domain.com/public/uploads/image.jpg 转到 laravel->public->uploads->image.jpg
2) http(s)://www.domain.com/api/test 转到 laravel->public->index.php
3) http(s)://www.domain.com/every_other_url 转到 angular->dist
我已经创建了这个 .htacces 文件
DirectoryIndex index.html index.htm default.htm index.php index.php3 index.phtml index.php5 index.shtml mwindex.phtml
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^api/(.*)$ laravel/public/$1 [L]
RewriteRule ^public/(.*)$ laravel/public/$1 [L]
RewriteCond %{REQUEST_URI} !^/angular/dist/
RewriteRule ^(.*)$ /angular/dist/$1
</IfModule>
第一个和第二个要求正常工作。现在我需要修复第三个
(我没有使用 HashLocationStrategy)
【问题讨论】:
标签: laravel .htaccess angular angular-routing