PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > How to combine rewrite rules
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
alt.apache.configuration Apache web server configuration issues.

How to combine rewrite rules

Réponse
 
LinkBack Outils de la discussion
Vieux 09/02/2007, 19h45   #1
laredotornado@zipmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to combine rewrite rules

Hi,

I'm using Apache 2.2. I have an .htaccess file that forces users to
authenticate

AuthType Basic
AuthUserFile "/home/dave/www/www/admin/.htpasswd"
AuthName Limited!
require valid-user

but my desire is that before users are prompted to log in, the URL is
rewritten if it lacks certain components. Specifically, if the URL
does not contain "www" as the first subdomain, I would like it added,
and if the URL does not begin with "https", I would like that to be
included. So, for example, if a user typed in "mydomain.com/admin",
the URL would be rewritten as "https://www.mydomain.com/admin".

How can I add these rewrite rules while at the same time only having
the user authenticate themselves once?

Thanks, - Dave

  Réponse avec citation
Vieux 09/02/2007, 19h55   #2
Davide Bianchi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to combine rewrite rules

On 2007-02-09, laredotornado@zipmail.com <laredotornado@zipmail.com> wrote:
> rewritten if it lacks certain components. Specifically, if the URL
> does not contain "www" as the first subdomain, I would like it added,


Use the UseCanonicalName directive to 'correct' the domain name.

> and if the URL does not begin with "https", I would like that to be
> included.


Then put a redirect in the http vhost to redirect to the https bit in
a <Location > directive.

Davide

--
Three of your friends throw up after eating chicken salad. Do you think
"I should find more robust friends" or "we should check that refrigerator"?
-- Donald Becker, on vortex-bug, suspecting a network-wide problem
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h51.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08851 seconds with 10 queries