2012-02-15 57 views
0

我將所有非www網址重定向到www。對,我用下面的htaccess的規則:非www到www重定向裏面的文件夾重定向404

RewriteCond %{HTTP_HOST} . 
RewriteCond %{HTTP_HOST} !^www.example.com [NC] 
RewriteRule (.*)$ http://www.example.com/$1 [R=301,L] 

大多數URL的其工作,除了這一個:

example.com/admin/stats.php 

stats.php放在管理文件夾內。 [/ public_html/admin /]。當我嘗試上述網址,它返回找不到404和重定向的URL是www.example.com/401.shtml

在同一htaccess中

RewriteRule ^([^/]+)/([^\.]+)\.html$ predicts.php?cn=$1&dte=$2 [L] 
RewriteRule ^([a-z]{2})/?$ index.php?cn=$1 
RewriteRule ^prediction/([0-9]*)/(.*)/?$ common.php?pid=$1 [L] 
RewriteRule ^profile/(.*)/?$ profile.php?id=$1 [L] 

那麼,什麼是這裏的問題等重定向?任何幫助非常感謝,謝謝!

+0

你有什麼其他rewriterules? – ThinkingMonkey 2012-02-15 05:41:55

+0

@ThinkingMonkey我在編輯中更新了這些規則。請檢查一下 – VKGS 2012-02-15 06:16:00

+0

這個'.htaccess'駐留在哪裏?你在管理文件夾的'htaccess'中是否有其他重寫? – ThinkingMonkey 2012-02-15 06:19:24

回答

1

是您的admin文件夾auth安全嗎?我的意思是你需要輸入一個username/password來獲得訪問權限嗎?另外,你有一個401.shtml?當HTTP Error 401 Unauthorized occurs時,URL被重定向到此。

+0

htaccess管理文件夾內導致的問題,現在我刪除它,它工作... – VKGS 2012-02-15 12:58:56