![](/img/trans.png)
[英]Problem in apache2 with mod rewrite when setting rules in .conf files instead of .htaccess
[英]htaccess rules on apache2
我需要一个我不明白的 .htaccess 文件。 我正在将 linux 与 apache2 一起使用,无法确定问题所在。 我有这个工作但改变了一些东西并且不再工作了。 这是 .htaccess。我想说我刚刚开始修复这个遗留软件中的错误。 我比 php 开发人员更像 Js。
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
Header set X-Content-Type-Options "nosniff"
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我正在使用虚拟主机。 我可以看到 myhost.com 但很快点击一个链接,我得到一个 404 未找到错误我知道是 apache 或 php,因为这段代码在另一台服务器上工作。 我想。 他们是这么说的。 请。 谢谢。
抱歉,我在网站可用的 conf 文件上有错字
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.