我的htaccess文件中有重定向无法使用。我做错什么了吗?

时间:2019-12-12 17:13:24

标签: apache .htaccess redirect

我的htaccess文件中有一系列规则,试图在我的网站上创建一些永久重定向,但这些规则无法正常工作。

这是代码,我希望任何人都能告诉我为什么它不起作用以及如何使重定向起作用:

import ast
df[['choice','host']]=df[['choice','host']].applymap(ast.literal_eval)

[...]

RedirectMatch 404 /\.git

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}/index.html !-f
    RewriteCond %{REQUEST_FILENAME}/index.php !-f
    RewriteRule . index.php [L]

    RewriteRule ^about-us$ /about/$1 [L,R=301]
    RewriteRule ^about-us/our-history$ /about/$1 [L,R=301]
    RewriteRule ^about-us/our-values$ /about/$1 [L,R=301]
    RewriteRule ^accessibility$ /accessibility/$1 [L,R=301]
    RewriteRule ^about-us/memberships-accreditations$ /accreditations-certificates/$1 [L,R=301]
    RewriteRule ^careers/working-for-us$ /careers/$1 [L,R=301]
    RewriteRule ^cookies$ /cookies/$1 [L,R=301]

0 个答案:

没有答案