[英]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.