Angular建议htaccess的任何路由都失败;

时间:2018-10-21 20:56:26

标签: angular apache .htaccess

我正在尝试使用Angular文档中推荐的.htaccess:

def combs(l, n):
    x = [0] * (n + 1)  # First element is not used, easier indexing
    a = [0] * (n + 1)
    for i in range(4, n+1):
        a[i] = a[i-1] + (l-1) * (a[i-2] + (l-1) * (l**(i-3) - (l-1)**(i-3)))
        x[i] = a[i] + (l-1) * x[i-1]
    return x[4:]

print(combs(2, 10))
print(combs(3, 10))
print(combs(4, 10))

但是,我有一些带有由angular构建的参数的链接,例如:

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

我得到了

/login;referrer=%2F

在测试中,删除Not Found The requested URL /login;referrer=/ was not found on this server. 是可行的。不知道为什么。

我无法弄清楚需要更改为.htaccess中的内容才能正常工作;似乎应该使用目录或文件以外的任何内容,并将其传递给我的index.html。

0 个答案:

没有答案