查看單個文章
  #1  
舊 2018-10-07, 12:46 PM
jimhuang jimhuang 目前離線
普通會員
 
註冊日期: 2003-10-23
文章: 67
預設 htaccess 求助!

我的網站htaccess:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
ErrorDocument 404 /404.php
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

子資料夾htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.xxx\.com)?$
RewriteRule ^(.*)$ https://xxx.com/japan/$1 [R=301,L]
</IfModule>

如果輸入 xxx.com/wrong-url 可以正確轉到404.php
但是輸入 xxx.com/japan/wrong-url 卻都不會轉到404.php

Google找不到答案
請問要如何更將子資料夾所有不正確網址(有/ 或 無/)轉至404
回覆時引用此篇文章