Add .htaccess rule
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent e76e6ee056
commit 094c67736b

@ -2,12 +2,14 @@ RewriteEngine on
# Vérifier si le serveur est MAMP ou WAMP # Vérifier si le serveur est MAMP ou WAMP
RewriteCond %{DOCUMENT_ROOT} /Applications/MAMP/htdocs/ RewriteCond %{DOCUMENT_ROOT} /Applications/MAMP/htdocs/
RewriteCond %{REQUEST_URI} !/$
RewriteRule .* - [E=APP_ROOT:/SAE4.01_FORMULAIRE/] RewriteRule .* - [E=APP_ROOT:/SAE4.01_FORMULAIRE/]
RewriteCond %{DOCUMENT_ROOT} / RewriteCond %{DOCUMENT_ROOT} /
RewriteRule .* - [E=APP_ROOT:] RewriteRule .* - [E=APP_ROOT:]
# Redirection des URLs # Redirection des URLs
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1/ [L,R=301]
RewriteRule ^/$ %{ENV:APP_ROOT}index.php?page=goToForm [L] RewriteRule ^/$ %{ENV:APP_ROOT}index.php?page=goToForm [L]
RewriteRule ^goToForm$ %{ENV:APP_ROOT}index.php?page=goToForm [L] RewriteRule ^goToForm$ %{ENV:APP_ROOT}index.php?page=goToForm [L]
RewriteRule ^submitForm$ %{ENV:APP_ROOT}index.php?page=submitForm [L] RewriteRule ^submitForm$ %{ENV:APP_ROOT}index.php?page=submitForm [L]

@ -83,7 +83,6 @@ class FrontController
protected function mapRoutes(): void protected function mapRoutes(): void
{ {
global $controller; global $controller;
$this->router->setBasePath('/');
$this->router->map('GET', '/', array($controller['Candidate'], 'goToForm'), 'goToForm'); $this->router->map('GET', '/', array($controller['Candidate'], 'goToForm'), 'goToForm');
$this->router->map('POST', '/submitForm', array($controller['Candidate'], 'submitForm'), 'submitForm'); $this->router->map('POST', '/submitForm', array($controller['Candidate'], 'submitForm'), 'submitForm');
$this->router->map('POST', '/addQuestion', array($controller['Admin'], 'addQuestion'), 'addQuestion'); $this->router->map('POST', '/addQuestion', array($controller['Admin'], 'addQuestion'), 'addQuestion');

Loading…
Cancel
Save