HTTPS and authentication problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

HTTPS and authentication problem

Postby lpastor » 19. September 2006 11:05

Hello,

I have put a .htaccess like this in a directory :

RewriteEngine On

RewriteCond %{HTTPS} "off"
RewriteRule ^(.*)$ https://%{SERVER_NAME}/test/$1 [R=301,L]

AuthName "xampp user"
AuthType Basic
AuthUserFile "D:\Xampp\xampp\security\xampp.users"
require valid-user

That work well, I have the redirection http -> https, but the window of authentification appears systematically twice. How to have it only once?

If I delete this (

AuthName "xampp user"
AuthType Basic
AuthUserFile "D:\Xampp\xampp\security\xampp.users"
require valid-user

) I haven't authentication.


For information my alias "test" in httpd.conf is :

Alias /test "D:/Xampp/xampp/htdocs/Tests/"

<directory "D:/Xampp/xampp/htdocs/Tests">
Options Indexes MultiViews Includes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</directory>

Thanks in advance,

Laurent
lpastor
 
Posts: 5
Joined: 07. September 2006 19:25

Postby Izzy » 19. September 2006 11:19

Have you tried putting the authentication instructions at the top of the htaccess file above the rewrite directive?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby lpastor » 19. September 2006 12:18

Yes I do that, its the same problem.

And if I delete (
RewriteEngine On

RewriteCond %{HTTPS} "off"
RewriteRule ^(.*)$ https://%{SERVER_NAME}/test/$1 [R=301,L]
)

then I have only one authentication (that's good) but without https redirection.

Laurent
lpastor
 
Posts: 5
Joined: 07. September 2006 19:25

Postby lpastor » 19. September 2006 14:23

I have found the solution without .htaccess

In the httpd.conf :

<directory "D:/Xampp/xampp/htdocs/Tests">
Options Indexes MultiViews Includes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all

RewriteEngine On
RewriteBase /htdocs/Tests
RewriteCond %{HTTPS} "off"
RewriteRule ^(.*)$ https://localhost/test/$1
</directory>

And in the httpd-ssl.conf :

<Directory "D:/Xampp/xampp/htdocs/Tests">
AuthName "xampp user"
AuthType Basic
AuthUserFile "D:\Xampp\xampp\security\xampp.users"
require valid-user
</Directory>
lpastor
 
Posts: 5
Joined: 07. September 2006 19:25


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 83 guests