2012-02-15 126 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