Jump to content

Htaccess Apache 2.4


Recommended Posts

Bonjour,

 

Ma boutique est en erreur 500.
J'ai contacté mon hébergeur qui me dit que le problème doit venir du htaccess car il a updaté la version apache de 2.2 vers 2.4 Debian 8.
Y a til quelqu'un qui pourrait m'indiquer ce qu'il faut ajouter ou modifier sur le Htaccess.

Merci infiniment pour votre aide

 

Sab

Link to comment
Share on other sites

Voilà merci:

 

 

IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
 
RewriteEngine on
 
 
#Domain: www.xxxxxxx.com
RewriteRule . - [E=REWRITEBASE:/proshop/]
RewriteRule ^api$ api/ [L]
 
RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
 
# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
 
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
#</IfModule>
 
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$">
Header add Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
 
 
#If rewrite mod isn't enabled
ErrorDocument 404 /proshop/index.php?controller=404
 
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
  • Haha 1
Link to comment
Share on other sites

réessaie de regénérer le .htaccess (préférences, seo & url, tu changes "url simplifiée" par exemple, tu sauves et tu remets comme avant

 

attention aussi, ta ligne "redirectPermanent" est mal placée : elle doit être avant ou après les "Do not remove" sinon elle sera perdue quand PS regenèrera le .htaccess

et il faudrait que tu la dupliques en retirant les / en fin d'url, car là, la page d'accueil en anglais n'est pas redirigée

Link to comment
Share on other sites

Merci Johann mais je n'ai pas accès au BO

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, 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.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Edited by Sab74 (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Bonjour SAB74, as-tu trouvé une solution à ton problème ? Car j'ai le même soucis j'ai l'impression.

Mon hébergeur est en train de migrer mon site sur un nouveau serveur avec la version 2.4 d'apache.

Nous avons transféré tous les fichiers ainsi que toute la base de données, et mon site affiche une erreur 404, alors qu'il n'y a que le serveur qui a changé, impossible de trouver d'où vient le problème.
J'ai désactivé la réécriture d'url : mon site fonctionne, dès que je la réactive il plante.

J'ai effacé mon .htaccess pour le re générer mais rien n'y fait !!

 

Merci d'avance

Link to comment
Share on other sites

Bonjour,

Le problème est réglé pour moi, cela venait de mon hébergeur.

Je te donne ma solution si jamais ça peut t'aider.

J'ai dit à mon hébergeur de passer ses réglages dans la configuration apache
AllowOverride None par : AllowOverride All

Il m'a dit que c'était déjà en place, rien n'a changé.

 

Et en fait aujourd'hui il m'a dit qu'il fallait que le réglage « AllowOverride » soit modifié dans le fichier de configuration principal d’Apache.

Il l'a fait et ça fonctionne. Essaye de voir avec ton hébergeur si tu n'as toujours pas réglé ton problème.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...