Bonjour,
J'arrive pas interdire URL dans Apache 2.2 sur Deian 5.0.
J'essaye d'interdire tout sauf /aaa/bbb sur https://test.domaine.fr
/aaa/bbb est une Web Service et pas de répéertoire.
J'ai essayé trois differents configurations, mais tout est en Forbidden ou Bad Request:
Conf 1:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/aaa/bbb$
RewriteRule ^(.*) %{REQUEST_URI}/ [R=403,L]
Message d'erreur:
https://test.domaine.fr
Forbidden
You don't have permission to access / on this server.
https://test.domaine.fr/aaa/bbb
Forbidden
You don't have permission to access /index.php on this server.
Conf 2:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/ws/get-user-abo-infos$
RewriteRule ^(.*) https://test.domaine.fr/aaa/bbb/index.php?q=$1 [R=403,L]
Message d'erreur:
même chose que Conf 1
Conf 3:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/aaa/bbb$
RewriteCond %{QUERY_STRING} !^/q=aaa/bbb$
RewriteRule ^(.*)$ https://test.domaine.fr [L,R=301]
RewriteCond %{REQUEST_URI} ^/aaa/bbb$
RewriteRule ^(.+)$ index.php?q=$1 [L,QSA]
Message d'erreur:
https://test.domaine.fr
Forbidden
You don't have permission to access / on this server.
https://test.domaine.fr/aaa/bbb
Bad Request
Your browser sent a request that this server could not understand.
Fichier .htaccess, partie index.php
/var/www# grep index .htaccess
ErrorDocument 404 /index.php
DirectoryIndex index.php
RewriteRule ^index\.do$ http://www.test.domaine.fr.fr:80/? [L,R=301]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Quelq'un pourrait m'aider?
Merci.
Partager