Dès que mon . Htaccess dépasse environ 8410 octets, je reçois une 500 erreur de serveur interne .
Je ne pense pas que cela soit dû à une mauvaise redirection, car j'ai expérimenté des redirections dans le . Htaccess , puis uniquement avec du texte mis en commentaire. #
. (aucune commande réelle dans le fichier . htaccess )
Y a-t-il quelque chose d'évident qui peut causer ceci?
Mise à jour:
Le site est sur WordPress.
Voici les redirections que j'essayais à l'origine d'ajouter:
RewriteEngine On
## 301 Redirects of old URLs to new
# 301 Redirect 1
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^accesseries/underlay/prod_37\.html$ /product-category/accessories/underlays? [R=301,NE,NC,L]
# 301 Redirect 2
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^accessories/acoustic-underlay/prod_29\.html$ /product/acoustic-underlay/? [R=301,NE,NC,L]
# 301 Redirect 3
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^accessories/cat_4\.html$ /product-category/accessories/? [R=301,NE,NC,L]
# 301 Redirect 4
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/accessories/cat_8\.html$ /product-category/accessories/? [R=301,NE,NC,L]
# 301 Redirect 5
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/bamboo-floor/natural-strandwoven-bamboo-semi-gloss-wide-board-135mm-click/prod_151\.html$ /product/natural-strand-woven-bamboo-semi-gloss-wide-board-135mm-click/? [R=301,NE,NC,L]
# 301 Redirect 6
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/bamboo-floor/strandwoven-chocolate-135mm-bamboo-flooring/prod_174\.html$ /product/strand-woven-chocolate-135mm-bamboo-flooring/? [R=301,NE,NC,L]
# 301 Redirect 7
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/bamboo-floor/strand-woven-kempas-bamboo-flooring/prod_173\.html$ /product/strand-woven-kempas-bamboo-flooring/? [R=301,NE,NC,L]
# 301 Redirect 8
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/bamboo-floor/strandwoven-walnut-wired-135mm-bamboo-flooring/prod_176\.html$ /product/strand-woven-walnut-wired-135mm-bamboo-flooring/? [R=301,NE,NC,L]
# 301 Redirect 9
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-flooring/cat_7\.html$ /product-category/bamboo-floor/? [R=301,NE,NC,L]
# 301 Redirect 10
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-bamboo-installation/info_8\.html$ /bamboo-installation/? [R=301,NE,NC,L]
# 301 Redirect 11
RewriteCond %{QUERY_STRING} ^act=cart$ [NC]
RewriteRule ^cart\.php$ /cart/? [R=301,NE,NC,L]
# 301 Redirect 12
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^contact-us/info_2\.html$ /contact-us/? [R=301,NE,NC,L]
# 301 Redirect 13
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^faqs/info_9\.html$ /faqs/? [R=301,NE,NC,L]
# 301 Redirect 14
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-floating-timber-floor/black-butt-engineered-floating-timber/prod_213\.html$ /product/black-butt-engineered-floating-timber/? [R=301,NE,NC,L]
# 301 Redirect 15
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-floating-timber-floor/doussie-engineered-floating-timber/prod_208\.html$ /product/doussie-engineered-floating-timber/? [R=301,NE,NC,L]
# 301 Redirect 16
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-floating-timber-floor/smoked-Oak-engineered-floating-timber/prod_217\.html$ /product/smoked-Oak-engineered-floating-timber/? [R=301,NE,NC,L]
# 301 Redirect 17
RewriteCond %{QUERY_STRING} ^act=thanks$ [NC]
RewriteRule ^index\.php$ http://www.xxxxxxxxxx.com/? [R=301,NE,NC,L]
# 301 Redirect 18
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=13$ [NC]
RewriteRule ^index\.php$ /product-category/samples/bamboo-flooring-samples/? [R=301,NE,NC,L]
# 301 Redirect 19
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=18$ [NC]
RewriteRule ^index\.php$ /product/bamboo-plastic-composite/? [R=301,NE,NC,L]
# 301 Redirect 20
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=2$ [NC]
RewriteRule ^index\.php$ /product-category/bamboo-floor/? [R=301,NE,NC,L]
# 301 Redirect 21
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=20$ [NC]
RewriteRule ^index\.php$ /products/? [R=301,NE,NC,L]
# 301 Redirect 22
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=3$ [NC]
RewriteRule ^index\.php$ /product-category/floating-timber-floor/? [R=301,NE,NC,L]
# 301 Redirect 23
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=5$ [NC]
RewriteRule ^index\.php$ /product-category/laminate-flooring/? [R=301,NE,NC,L]
# 301 Redirect 24
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=6$ [NC]
RewriteRule ^index\.php$ /product-category/accessories/? [R=301,NE,NC,L]
# 301 Redirect 25
RewriteCond %{QUERY_STRING} ^act=viewCat&catId=saleItems$ [NC]
RewriteRule ^index\.php$ /product-category/clearance-sale/? [R=301,NE,NC,L]
# 301 Redirect 26
RewriteCond %{QUERY_STRING} ^act=viewDoc&docId=3$ [NC]
RewriteRule ^index\.php$ /faqs/? [R=301,NE,NC,L]
# 301 Redirect 27
RewriteCond %{QUERY_STRING} ^act=viewDoc&docId=4$ [NC]
RewriteRule ^index\.php$ /faqs/? [R=301,NE,NC,L]
# 301 Redirect 28
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=137$ [NC]
RewriteRule ^index\.php$ /product/laminate-flooring-goustein-wood/? [R=301,NE,NC,L]
# 301 Redirect 29
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=164$ [NC]
RewriteRule ^index\.php$ /product/modern-black-brushed-finish-strand-woven-flooring/? [R=301,NE,NC,L]
# 301 Redirect 30
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=165$ [NC]
RewriteRule ^index\.php$ /product/Lime-wash-strand-woven-bamboo-flooring/? [R=301,NE,NC,L]
# 301 Redirect 31
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=168$ [NC]
RewriteRule ^index\.php$ /product/country-bark/? [R=301,NE,NC,L]
# 301 Redirect 32
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=173$ [NC]
RewriteRule ^index\.php$ /product-category/bamboo-floor/14mm-bamboo-flooring/? [R=301,NE,NC,L]
# 301 Redirect 33
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=178$ [NC]
RewriteRule ^index\.php$ /product/blue-gum-136-floating-timber/? [R=301,NE,NC,L]
# 301 Redirect 34
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=199$ [NC]
RewriteRule ^index\.php$ /product/jarrah-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 35
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=205$ [NC]
RewriteRule ^index\.php$ /product/Elm-12mm-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 36
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=209$ [NC]
RewriteRule ^index\.php$ /product/iroko-engineered-floating-timber/? [R=301,NE,NC,L]
# 301 Redirect 37
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=222$ [NC]
RewriteRule ^index\.php$ /product/european-Oak-engineered-floating-timber-sample/? [R=301,NE,NC,L]
# 301 Redirect 38
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=236$ [NC]
RewriteRule ^index\.php$ /product/black-forest-5mm-vinyl-flooring/? [R=301,NE,NC,L]
# 301 Redirect 39
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=65$ [NC]
RewriteRule ^index\.php$ /product/stair-nose/? [R=301,NE,NC,L]
# 301 Redirect 40
RewriteCond %{QUERY_STRING} ^act=viewProd&productId=83$ [NC]
RewriteRule ^index\.php$ /product/laminate-flooring-warm-teak/? [R=301,NE,NC,L]
# 301 Redirect 41
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/12mm-laminate-flooring/blackbutt/prod_156\.html$ /product/blackbutt-12mm-laminate-floor/? [R=301,NE,NC,L]
# 301 Redirect 42
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/12mm-laminate-flooring/tasmanian-Oak/prod_171\.html$ /product/tasmanian-Oak/? [R=301,NE,NC,L]
# 301 Redirect 43
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/8-3mm-laminate-flooring/laminate-flooring-warm-teak/prod_8\.html$ /product/laminate-flooring-warm-teak/? [R=301,NE,NC,L]
# 301 Redirect 44
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/accessories/cat_6\.html$ /product-category/accessories/? [R=301,NE,NC,L]
# 301 Redirect 45
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/cat_5\.html$ /product-category/laminate-flooring/? [R=301,NE,NC,L]
# 301 Redirect 46
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-flooring/country-classic-12mm-laminate/cat_19\.html$ /product-category/laminate-flooring/12mm-country-classic-laminate-floor/? [R=301,NE,NC,L]
# 301 Redirect 47
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-laminate-installation/info_7\.html$ /laminate-installation/? [R=301,NE,NC,L]
# 301 Redirect 48
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^privacy-policy/info_4\.html$ /faqs/? [R=301,NE,NC,L]
# 301 Redirect 49
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^-quotation-request/info_5\.html$ /quotation-request/? [R=301,NE,NC,L]
# 301 Redirect 50
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^Rainbow-flooring/cat_16\.html$ /product-category/Rainbow-flooring/? [R=301,NE,NC,L]
# 301 Redirect 51
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^Rainbow-flooring/walnut-Rainbow-flooring/prod_112\.html$ /product/walnut-Rainbow-flooring/? [R=301,NE,NC,L]
# 301 Redirect 52
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/12mm-laminate-floor-samples/kempas-laminate-floor-sample/prod_195\.html$ /product/kempas-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 53
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/12mm-laminate-floor-samples/spotted-gum-laminate-floor-sample/prod_196\.html$ /product/spotted-gum-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 54
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/12mm-laminate-floor-samples/tasmanian-Oak-laminate-floor-sample/prod_197\.html$ /product/tasmanian-Oak-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 55
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/bamboo-flooring-samples/cat_13\.html$ /product-category/samples/bamboo-flooring-samples/? [R=301,NE,NC,L]
# 301 Redirect 56
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/bamboo-flooring-samples/rosewood-strandwoven-bamboo-floor-135mm-click-sample/prod_191\.html$ /product/rosewood-strand-woven-bamboo-floor-135mm-click-sample/? [R=301,NE,NC,L]
# 301 Redirect 57
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/cat_9\.html$ /samples/? [R=301,NE,NC,L]
# 301 Redirect 58
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/floating-timber-floor-samples/iroko-engineered-floating-timber-floor-sample/prod_223\.html$ /product/iroko-engineered-floating-timber-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 59
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/floating-timber-floor-samples/jarrah-engineered-floating-timber-sample/prod_224\.html$ /product/jarrah-engineered-floating-timber-sample/? [R=301,NE,NC,L]
# 301 Redirect 60
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/floating-timber-floor-samples/merbau-engineered-floating-timber-sample/prod_226\.html$ /product/merbau-engineered-floating-timber-sample/? [R=301,NE,NC,L]
# 301 Redirect 61
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/floating-timber-floor-samples/spotted-gum-engineered-floating-timber-sample/prod_228\.html$ /product/spotted-gum-engineered-floating-timber-sample/? [R=301,NE,NC,L]
# 301 Redirect 62
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^samples/floating-timber-floor-samples/sydney-blue-gum-engineered-floating-timber-sample/prod_220\.html$ /product/sydney-blue-gum-engineered-floating-timber-sample/? [R=301,NE,NC,L]
# 301 Redirect 63
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/-laminate-flooring/accessories/laminate-flooring-accessories-click-stairnose/prod_251\.html$ /product/stair-nose/? [R=301,NE,NC,L]
# 301 Redirect 64
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/-laminate-flooring/country-classic-12mm-laminate/country-classic-polar-white/prod_243\.html$ /product/country-classic-polar-white/? [R=301,NE,NC,L]
# 301 Redirect 65
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/samples/12mm-laminate-floor-samples/country-classic-polar-white/prod_244\.html$ /product/country-classic-polar-white-sample/? [R=301,NE,NC,L]
# 301 Redirect 66
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/samples/12mm-laminate-floor-samples/rustic-Oak-12mm-laminate-floor/prod_248\.html$ /product/rustic-Oak-12mm-laminate-floor-sample/? [R=301,NE,NC,L]
# 301 Redirect 67
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/samples/vinyl-flooring-samples/cat_25\.html$ /product-category/samples/vinyl-flooring-samples/? [R=301,NE,NC,L]
# 301 Redirect 68
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^shop\.php/vinyl-flooring/cat_24\.html$ /product-category/vinyl-floor/? [R=301,NE,NC,L]
# 301 Redirect 69
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^solardeck-tiles/cat_22\.html$ /product-category/solardeck-tiles/? [R=301,NE,NC,L]
# 301 Redirect 70
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^solardeck-tiles/solardeck-tiles/prod_206\.html$ /product/solardeck-tiles/? [R=301,NE,NC,L]
# 301 Redirect 71
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^terms-conditions/info_3\.html$ /faqs/? [R=301,NE,NC,L]
Je reçois des erreurs comme celle-ci dans mon journal:
Invalid command 'aminate-flooring/tasmanian-Oak/prod_171\\.html$', perhaps misspelled or defined by a module not included in the server configuration, referer: http://www.xxxxxxxx.com/laminate-installation/
Invalid command ',NE,NC,L]', perhaps misspelled or defined by a module not included in the server configuration
Invalid command ',L]#', perhaps misspelled or defined by a module not included in the server configuration
Je ne pense pas que cela soit lié à la taille du fichier.
Très probablement, certaines de vos lignes sont problématiques, peut-être contiennent des caractères de contrôle ou autres. Le mieux serait d’essayer d’ajouter des lignes une par une et de les recharger, et de voir quand vous commencez à recevoir des erreurs - la ligne que vous avez ajoutée est probablement le coupable n’est pas un problème alors la moitié de ce qui manque, etc.).
À 8410
octets, la taille n'est pas le problème. Le seul problème imaginable avec la taille serait si Apache ou d'autres processus dépassaient la mémoire de votre système ...
Sans voir le .htaccess
actuel, je suggère de réduire le problème en supprimant successivement les lignes. Vérifiez également que les lignes se terminent par des caractères de nouvelle ligne \n
afin qu’elles ne soient pas combinées (c’est-à-dire, affichez-les dans un éditeur de texte qui affiche les caractères de nouvelle ligne).
Remarque: la réponse ci-dessus a été donnée avant les commentaires ci-dessous, et le PO a ajouté des mises à jour sur le fait d'être sur WordPress et d'inclure les extraits de journal .htaccess et du journal des erreurs (voir les commentaires et les modifications apportées à la question).