Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
August 25, 2008 - Time to Vote for the August 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 29, 2008, 02:07:53 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: htaccess redirect not working from mydomain.com to www.mydomain.com  (Read 64 times)
altoidboy
Spacescooter Operator
*****
Offline Offline

Posts: 39


« on: July 22, 2008, 09:00:21 AM »

i hope i can explain this clearly. i have mydomain.com hosted at lunarpages. i do have an .htaccess file at the root level of the public_html folder and it has this in it:

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

this seems to work fine. whether users visit mydomain.com or www.mydomain.com, they get redirected to www.mydomain.com and the site works perfectly.

now, i created a new subfolder inside public_html called "projects" and a subfolder inside that called "one". so the full path is www.mydomain.com/projects/one

here's the problem.

if i go to either mydomain.com/projects or www.mydomain.com/projects, everything works fine, as expected.

if i go to www.mydomain.com/projects/one, everything works fine as expected.

but if i go to mydomain.com/projects/one i get an error 401. it does not redirect.

any ideas?? i'm absolutely stumped.

a couple of related notes. i did put a password on the /one folder (via lunarpages cp). inside the one folder is a php script called filenice (which i use elsewhere with no problems). the entire site (at the root level of public_html) is running a joomla 1.0.15 installation. i don't know if any of these details will be useful.
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3235



« Reply #1 on: July 22, 2008, 08:51:22 PM »

So mydomain.com/projects redirects nicely to www.mydomain.com/projects/, but mydomain.com/projects/one gives a 401 error instead of redirecting to www.mydomain.com/projects/one/? I vaguely recall seeing some recent discussions indicating that such redirection doesn't play nice with password-protected directories. I don't recall where, but maybe you can find them with an advanced search. If you can solidly reproduce this and have narrowed it down to the fact that password protection is clashing with redirection, I'd certainly open a ticket with support. It's possible that they'll tell you that nothing can be done about it, but still, it's worth a try. Also look at various sites which discuss advanced magic with .htaccess and redirection, and sites that cover the use of password protection, and see if anything is said about this as a general problem.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM