I'm redirecting all non www urls to www. for that i've used the following htaccess rules:

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

for most of the urls its working, except this one:

example.com/admin/stats.php

stats.php placed inside admin folder. [ /public_html/admin/ ]. When i try above url it returns 404 not found and the redirected url is www.example.com/401.shtml

other redirects in the same htaccess files

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]

So what is the issue here? Any help greatly appreciated, Thanks!.

有帮助吗?

解决方案

Is your admin folder auth secured? I mean do you need to enter a username/password to gain access? Also, do you have a 401.shtml? URL gets redirected to this when HTTP Error 401 Unauthorized occurs.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top