Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Situation du problème:
Message d'erreur interne du serveur (500) avec l'utilisation de .htaccess
Si vous pouvez m'aider, j'en suis vraiment ravi et merci d'avance de votre part...
Alors...
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
Version Zend 1.11.3
Wamp :
MySQL 5.1.36
PHP 5.3.0
Apache 2.2.11
Configuration du host
127.0.0.1 mvc_utile.com
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Création du projet avec : zf create project mvc_utile
"Pas de problème"
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Situation A
Configuration prise dans /wamp/bin/apache/Apache x.x.xx/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot 'C:/Program Files/wamp/www/mvc_utile/public'
ServerName mvc_utile.com
SetEnv APPLICATION_ENV 'development'
<Directory 'C:/Program Files/wamp/www/mvc_utile/public'>
DirectoryIndex "C:/Program Files/wamp/www/mvc_utile/public/index.php"
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Résultat de mvc_utile.com: Message 500(Internal error)
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Situation B
Fichier .htaccess supprimé
Même configuration du httpd.conf que la situation A
Résultat de mvc_utile.com: Message 403(Forbidden)
Mais si on tente avec mvc_utile.com/index/index
La requête est acceptée et les liens aussi
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Situation C
Fichier .htaccess utilisé
Configuration prise dans /wamp/bin/apache/Apache x.x.xx/conf/httpd.conf
<VirtualHost *:80>
DocumentRoot 'C:/Program Files/wamp/www/mvc_utile/public'
ServerName mvc_utile.com
SetEnv APPLICATION_ENV 'development'
<Directory 'C:/Program Files/wamp/www/mvc_utile/public'>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Résultat de mvc_utile.com: Message 500(Internal error)
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Situation D
Fichier .htaccess supprimé
Même configuration du httpd.conf que la situation C
Résultat de mvc_utile.com: la page index.phtml est interprété
Pourtant, les liens ne sont pas accessible sauf pour index:
portion de code régit dans index.phtml
// Lien accessible
<a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'index')); ?>">Accueil</a>
// Message 404(Not found)
<a href="<?php echo $this->url(array('controller'=>'index', 'action'=>'modifier')); ?>">Modifier</a>
Hors ligne
Bonjour,
Dans le cas A, le DirectoryIndex n'est pas bon (index.php, pas "C:/Program Files/wamp/www/mvc_utile/public/index.php")...
Hors ligne
Merci!
Je vous remercie de ton aide précieuse, j'essai ça plus tard...
Hors ligne
Encore, une précision de mon problème
----------------------------------------------------------------------------------------
Salut, si quelqu’un puisse m’aider s’il vous plait !
Voici le problème dont je ne sais pas maîtriser : quand j’utilise le fichier .htaccess pour le restriction d’accès, voilà ce que mon serveur me donne, toujours le message 500
Sans le fichier .htaccess, la requête est acceptée.
----------------------------------------------------------------------------------------
Voici la configuration du site :
1. Arborescence :
+ essai_apache
| .htaccess
| index.php
----------------------------------------------------------------------------------------
2. Création d’un alias
Alias /ESSAI/ "C:/Program Files/wamp/www/essai_Apache/"
<Directory "C:/Program Files/wamp/www/essai_Apache/">
AllowOverride AuthConfig
Options Indexes
IndexOptions FancyIndexing
IndexIgnore ..
Order allow,deny
Allow from all
</Directory>
----------------------------------------------------------------------------------------
3. Création d’un fichier de mot de passe
Répertoire : ‘C:\Program Files\wamp\bin\apache\Apache2.2.11\etc’
Commande : ‘htpasswd.exe -bc .htpasswd matice motdepasse’
----------------------------------------------------------------------------------------
4. Fichier .htaccess dans le répertoire du site
Authname 'ESSAI'
AuthUserFile 'C:/Program Files/wamp/bin/apache/Apache2.2.11/etc/.htpasswd'
AuthType Basic
require valid-user
----------------------------------------------------------------------------------------
5. Merci d’avance…
Hors ligne
Auto correction du premier sujet
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Pour le moment, pas de possibilité d'utiliser un fichier .htaccess
Un grand merci pour Théocrite
Configuration httpd.conf
<VirtualHost *:80>
DocumentRoot 'C:/Program Files/wamp/www/mvc_utile/public'
ServerName mvc_utile.com
SetEnv APPLICATION_ENV 'development'
<Directory 'C:/Program Files/wamp/www/mvc_utile/public'>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Auto correction du second sujet
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Paramètre du fichier .htaccess
>> AuthName
pas Authname
Hors ligne
Sans l'authentification .htacces/.htpasswd ça fonctionne ton .htaccess ?
Hors ligne
J'ai même utilisé un .htpasswd pour accéder à .htaccess mais plus rien, alors je travail sans .htaccess et .htpasswd.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Le site virtuel défini fonctionne, j'ai à peine comprendre un peu certain configuration de httpd.conf....mais pas pouvoir utiliser cette restriction.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Si j'essai d'acceder par exemple à mon_site.com/application/
On me redirige vite vers la page d'index du site.
Hors ligne