root
/question
/pages
index.html
.htaccess
/root/.htaccess
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/question
/問題/.htaccess
RewriteEngine On
#RewriteBase /
RewriteRule ^question/are-bitcoin-gains-taxable/?$ /pages/questions/viewQuestion.php?id=9 [L]
所以我想要做的是將我的 htaccess 分成目錄,這個當前的設定正在產生 /404 錯誤/pages/questions/viewQuestion.php?確實存在,我只是認為它沒有讀取第二個 .htaccess ,感謝您的幫助。
uj5u.com熱心網友回復:
為此,您不需要 root .htaccess 中的任何內容,并且 aRewriteCond本身并沒有做任何事情。
你只需要有這個規則/question/.htaccess
RewriteEngine On
RewriteRule ^are-bitcoin-gains-taxable/?$ /pages/questions/viewQuestion.php?id=9 [L,NC,QSA]
中的 URI 路徑RewriteRule是相對于 .htaccess 所在目錄的,因此question/此處不會匹配。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/418321.html
標籤:
