【发布时间】:2019-01-28 08:08:02
【问题描述】:
我有一个使用 apache 服务器运行的 Angular 项目。 apache 文档根是/var/www/angular/dist/my-project。在这个文件夹中,我创建了一个符号链接,它引用了我安装了 wordpress 的/var/www/wordpress 目录。在“000-default.conf”文件中我有
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(json|css|gif|ico|jpg|js|png|swf|txt|svg|woff|ttf|eot)$
#added this line to make the wordpress work
RewriteCond %{REQUEST_URI} !^/blog/
RewriteRule . /index.html [L]
但上面的代码不起作用。我总是得到角度项目 index.html
但是,如果我去 domain.com/blog 它再次返回 index.html。但是这个 index.html 页面不会像我输入任何随机 url 时那样显示 404。
【问题讨论】:
标签: angular wordpress apache .htaccess