Quelqu'un pourrait-il m'aider à convertir cette réécriture d'URL
########################################################
# package: minPHP
# filename: .htaccess
########################################################
<Files ~ ".(pdt)$">
order deny,allow
deny from all
</Files>
# Protect against Clickjacking
#Header append X-Frame-Options "SAMEORIGIN"
RewriteEngine on
# Force HTTPS
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php
RewriteCond %{REQUEST_URI} ^(.*)/install.php$
RewriteRule install.php %1/install/ [R=301,L]
Voici notre réécriture actuelle cela fonctionne bien mais unquelques erreurs. tels que /index.php/ étant toujours présents dans les liens alors que cela devrait être / client / login et que certaines pages vous obligent à télécharger un fichier intitulé "télécharger"
# Disallow access to any file with .pdt extension
location ~ (.pdt) {
return 403;
}
location / {
error_page 404 = @blesta; #IF file doesn"t exist
log_not_found off;
rewrite ^(.*)$ /index.php last;
# For access to install file
if ($request_uri ~ "^(.*)/install.php$"){
rewrite install.php /%1/install/ redirect;
}
}
Réponses:
1 pour la réponse № 1Les règles de réécriture de nginx pour blesta:
https://github.com/cloudrck/blesta-nginx/blob/master/sites-available/blestav3
Comment supprimer /index.php/ dans l'URL:
Editez lib / init.php, changez:
define("HTACCESS", file_exists(ROOTWEBDIR . ".htaccess"));
À:
define("HTACCESS", true);
ref: http://docs.blesta.com/display/user/Installing+Blesta#InstallingBlesta-SystemConfiguration