網域名稱俱樂部

網域名稱俱樂部 (https://www.domainclub.org/index.php)
-   一般軟體與網路使用討論 (https://www.domainclub.org/forumdisplay.php?f=43)
-   -   htaccess 求助! (https://www.domainclub.org/showthread.php?t=40744)

jimhuang 2018-10-07 12:46 PM

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


所有時間均為 +8。現在的時間是 06:54 PM

Powered by vBulletin® 版本 3.8.4
版權所有 ©2000 - 2024,Jelsoft Enterprises Ltd.