Jump to content

[RESOLU] Installation boutique sous- dossier // Probleme ré-écritures URL


Recommended Posts

Bonsoir ,

 

Je me permets de vous ennuyer car cela fait 3 jours que je cherche la solution à mon problème sur Presta et impossible de trouver la solution. Peut être vous une idée à me suggérer.

J'utilise Prestashop depuis 4 ans et l'installe d'habitude sur la racine du site . Mais concernant ma dernière boutique je l'ai mise dans un sous-dossier - Tout fonctionne correctement sauf l'url Rewritning lorsque je l'active –

 

Mon site est www.blancmarine.com et j’ai installé ma boutique Presta dans le dossier /velopliant/

Il s’agit de : www.blancmarine.com/velopliant

 

Je pense qu'il y a une modification à faire sur mon fichier .htaccess mais laquelle/ ou Ailleurs ?? Avez vous votre idée ??

 

Merci d’avance à toute la communauté

 

Vanessa (SARL Blanc marine)

 

NB : Je suis hébergée chez ovh . Et voici la copie du fichier .htaccess que j’utilise d’habitude avec mes autres boutiques sur OVH

 

 

SetEnv REGISTER_GLOBALS 0
SetEnv PHP_VER 5
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
# URL rewriting module activation
Options -Indexes
Options -Multiviews
Options +FollowSymLinks
SetEnv REGISTER_GLOBALS 0
SetEnv PHP_VER 5
RewriteEngine On
# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E]
# Catch 404 errors
ErrorDocument 404 /404.php
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType themes/concept6/mod/images/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
## EXPIRES CACHING ##
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Compression pour fichiers CSS
<IfModule mod_gzip.c>
   mod_gzip_on	   Yes
   mod_gzip_dechunk  Yes
   mod_gzip_minimum_file_size 1024
   mod_gzip_maximum_file_size 100000
   mod_gzip_item_include file \.css$
   mod_gzip_item_include mime ^text/css$
</IfModule>
<IfModule mod_expires.c>
   ExpiresActive on
   ExpiresDefault "access plus 1 month"
   ExpiresByType text/css "access plus 1 day"
   ExpiresByType image/png "access plus 1 week"
   ExpiresByType image/gif "access plus 1 week"
   ExpiresByType image/jpeg "access plus 1 week"
</IfModule>
# Compression pour fichiers JS
<IfModule mod_gzip.c>
   mod_gzip_on	   Yes
   mod_gzip_dechunk  Yes
   mod_gzip_minimum_file_size 512
   mod_gzip_maximum_file_size 1000000
   mod_gzip_item_include file \.js$
   mod_gzip_item_include mime ^application/x-javascript.*
</IfModule>
# Cache
<IfModule mod_expires.c>
   ExpiresActive on
   ExpiresByType application/x-javascript "access plus 2 month"
   ExpiresByType application/javascript "access plus 2 month"
   ExpiresByType text/javascript "access plus 2 month"
</IfModule>
# Apache 2.0
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
# MOD_DEFLATE COMPRESSION
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
#Pour les navigateurs incompatibles
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
#ne pas mettre en cache si ces fichiers le sont déjà
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
#les proxies doivent donner le bon contenu
Header append Vary User-Agent env=!dont-vary
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# KILL THEM ETAGS
Header unset ETag
FileETag none
# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
# protection de la lecture des répertoires
Options -Indexes

<Files *.tpl>
 deny from all
 allow from localhost
</Files>

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

Re,

 

J'ai fini par trouvé la solution. Pour éviter le "Problème résolu. - J'ai le même problème, comment avez-vous fait ?", voici la solution :

 

Solution 1 (automatique) :

- Regénérer un fichier .htaccess automatiquement à partir du backoffice de prestashop.

- L'éditer, puis rajouter le code restant :

 

## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType themes/concept6/mod/images/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
## EXPIRES CACHING ##
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
# Compression pour fichiers CSS
<IfModule mod_gzip.c>
   mod_gzip_on    Yes
   mod_gzip_dechunk  Yes
   mod_gzip_minimum_file_size 1024
   mod_gzip_maximum_file_size 100000
   mod_gzip_item_include file \.css$
   mod_gzip_item_include mime ^text/css$
</IfModule>
<IfModule mod_expires.c>
   ExpiresActive on
   ExpiresDefault "access plus 1 month"
   ExpiresByType text/css "access plus 1 day"
   ExpiresByType image/png "access plus 1 week"
   ExpiresByType image/gif "access plus 1 week"
   ExpiresByType image/jpeg "access plus 1 week"
</IfModule>
# Compression pour fichiers JS
<IfModule mod_gzip.c>
   mod_gzip_on    Yes
   mod_gzip_dechunk  Yes
   mod_gzip_minimum_file_size 512
   mod_gzip_maximum_file_size 1000000
   mod_gzip_item_include file \.js$
   mod_gzip_item_include mime ^application/x-javascript.*
</IfModule>
# Cache
<IfModule mod_expires.c>
   ExpiresActive on
   ExpiresByType application/x-javascript "access plus 2 month"
   ExpiresByType application/javascript "access plus 2 month"
   ExpiresByType text/javascript "access plus 2 month"
</IfModule>
# Apache 2.0
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript
# MOD_DEFLATE COMPRESSION
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
#Pour les navigateurs incompatibles
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
#ne pas mettre en cache si ces fichiers le sont déjà
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
#les proxies doivent donner le bon contenu
Header append Vary User-Agent env=!dont-vary
# BEGIN Expire headers
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 7200 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
AddType image/x-icon .ico
ExpiresByType image/ico "access plus 2592000 seconds"
ExpiresByType image/icon "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 2592000 seconds"
ExpiresByType text/html "access plus 7200 seconds"
ExpiresByType application/xhtml+xml "access plus 7200 seconds"
ExpiresByType application/javascript A259200
ExpiresByType application/x-javascript "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
</IfModule>
# END Expire headers
# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
<FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(css)$">
Header set Cache-Control "max-age=2592000, public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Cache-Control "max-age=2592000, private"
</FilesMatch>
<filesMatch "\\.(html|htm)$">
Header set Cache-Control "max-age=7200, public"
</filesMatch>
# Disable caching for scripts and other dynamic files
<FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
Header unset Cache-Control
</FilesMatch>
</IfModule>
# END Cache-Control Headers
# KILL THEM ETAGS
Header unset ETag
FileETag none
# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
# protection de la lecture des répertoires
Options -Indexes
<Files *.tpl>
 deny from all
 allow from localhost
</Files>

 

Solution 2 (manuelle) :

 

- Editer le début du fichier code (parties # URL rewriting rules et # Catch 404 errors ) en rajoutant le sous-domaine (pour ma part, "velopliant") comme ceci :

 

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /velopliant/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /velopliant/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /velopliant/product.php?id_product=$3&isolang=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /velopliant/product.php?id_product=$2&isolang=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /velopliant/category.php?id_category=$2&isolang=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /velopliant/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /velopliant/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /velopliant/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /velopliant/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /velopliant/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /velopliant/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /velopliant/$2?isolang=$1 [QSA,L,E]
# Catch 404 errors
ErrorDocument 404 /velopliant/404.php

 

Au final, mon site http://www.blancmarine.com et sa boutique http://www.blancmarine.com/velopliant fonctionnent sans aucun problème maintenant.

 

PROBLEME RESOLU !

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...