sitemap  |  contact

Sakic.Net Forum
07 January 2009, 20:11 *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Introducing AJAX Scroller - Joomla News Slider Module: http://www.sakic.net/news/introducing_ajax_scroller/
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: htpasswd/ htaccess in subdir, conflicting with sef advanced htaccess in root  (Read 1029 times)
deejay
Newbie
*
Posts: 2


View Profile
« on: 23 May 2007, 15:43 »

Hi,

I have joomla/ sef advanced installed with an oscommerce installation in the directory webshop.

when i try to install a username/ password in the admin directory (using htaccess/ htpasswd), it is in conflict with the .htaccess that resides in the root of joomla, made by sef advance.

I know this because when i delete the .htaccess of SEF advanced, the htpasswd/ htaccess in the directory /webshop/admin/ works Perfectly.

So something in these lines is also applied on all subdirectories, probably the last line;

#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

How can i prevent SEF from url rewriting in the webshop directory so i can use htpasswd properly Huh? If i am correct the above code says to exclude real directories but it prevents (/conflicts with) the following htaccess code in subdirectories (in my case the webshop/admin/ dir);

AuthUserFile /home/lifeline/domains/lifeline.ipxl.nl/public_html/webshop/admin/.htpasswd
AuthGroupFile /dev/null
AuthName "test Secret Section"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>

The problem is also explained here;
http://forum.joomla.org/index.php/topic,30653.0.html

Rgds, DJ
Logged
wwtn
Newbie
*
Posts: 1


View Profile
« Reply #1 on: 22 August 2008, 19:28 »

DJ,

Here's the solution to your problem...


See this as a reference to suggested fix:

http://forum.joomla.org/viewtopic.php?t=31813


Find this line of code in root .htaccess file:

Code:
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$


Replace the line of code above with the following:

Code:
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|#.*|\?.*|/[^.]*)$  [NC]


The final code modification in the root .htaccess file should look like this:

Code:
#  RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
#  RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|#.*|\?.*|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php


That will fix the problem with .htaccess and .htpasswd password protected directories falsely returning 404 server errors when Joomla v1.0.15 is SEF enabled along with SEF Advance installed and enabled.

Hope this helps you and others fix this problem.

Jim Sheridan
Worldwide TeleNet

http://www.wwtndesign.com
http://www.wwtnhosting.com
http://www.wwtndomains.com

Logged
Pages: [1]
  Print  
 
Jump to: