THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Toujours à la découverte de Thelia 2.3.3 je rencontre une erreur étrange :

je ne peux ajouter des articles à mon panier uniquement par l'intermédiaire de index_dev.php
impossible via l'url normale ! l'utilisation des boutons ne produit rien et lorsque j'essaye d'accèder à mon panier j'ai un :

Not Found

The requested URL /Distillerie2/web/cart was not found on this server.
Apache/2.4.18 (Ubuntu) Server at localhost Port 80

Merci d'avance

Last edited by AnTeBiOs (01-03-2017 22:29:03)

Offline


Si ton Thelia est installé dans un sous-répértoire (ce qui semble être le cas), il te faut modifier le fichier .htaccess. Dans ton cas, ce devrait être ça :

    # If thelia is installed in a subdirectory (e.g., thelia2)
    # define the RewriteBase below to get a proper URL rewriting
    RewriteBase /Distillerie2

OpenStudio Toulouse

Offline


Merci pour ta réponse,

J'ai modifié le .htaccess dans /web/, j'ai vidé le cache mais j'ai toujours le même problème ...

Offline


Le plus simple serait que tu fasses pointer le document root de ton vhost sur /Distillerie/web


OpenStudio Toulouse

Offline


Le truc c'est que j'ai plusieurs dossiers auquels j'ai besoin d'accèder, ça me semble fastidieux.
J'ai refait une installe de base dans un autre dossier Distillerie5/web J'ai créé un article pour voir et là tout fonctionne ... Je ne capte pas ce que j'ai pas bien fait ...

Offline


Bonsoir,

je continue mes investigations et je n'arrive pas à solder ce problème ...

Mon Vhost :

DocumentRoot /var/www/html/Distillerie5/web

Mon htaccess :

Options +FollowSymlinks -Indexes

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On

    # SEO, remove the subdomain www in URL
    # Exemple : http://www.yourdomain.com/contact redirect 301 to http://yourdomain.com/contact
    # To activate uncomment the following two lines
    #RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
    #RewriteRule ^(.*) http://yourdomain.com/$1 [QSA,L,R=301]

    # SEO, add the subdomain www in URL
    # Exemple : http://yourdomain.com/contact redirect 301 to http://www.yourdomain.com/contact
    # To activate uncomment the following two lines
    #RewriteCond %{HTTP_HOST} ^yourdomain.com$
    #RewriteRule ^(.*) http://www.yourdomain.com/$1 [QSA,L,R=301]

    # SEO, to avoid duplicate content with index.php in url
    # Exemple : http://www.yourdomain.com/index.php/contact redirect 301 to http://www.yourdomain.com/contact
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteRule (.?)index\.php/(.*) /$1$2 [R=301,NE,L]

    # If thelia is installed in a subdirectory (e.g., thelia2)
    # define the RewriteBase below to get a proper URL rewriting
    # RewriteBase /Distillerie5

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php [QSA,L]
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
</IfModule>

si je saisis dans mon navigateur Firefox : http://localhost/ j'obtiens : Redirecting...

Not Found

The requested URL /web/ was not found on this server.

Apache/2.4.18 (Ubuntu) Server at localhost Port 80

si je saisis dans mon navigateur Firefox : http://localhost/index.php  c'est ok la page s'affiche

peu importe comment je le saisis dans mon navigateur Chrome la page s'affiche ... C'est ensuite que ça se gâte.
Depuis la page d'accueil si je clique sur un lien catégorie de produit ou produit pas de soucis. J'obtiens ce genre d'url : http://localhost/?view=category&lang=fr_FR&category_id=1
Si je clique sur le panier ou le formulaire de contact j'obtiens : http://localhost/account

 Not Found

The requested URL /account was not found on this server.

Apache/2.4.18 (Ubuntu) Server at localhost Port 80

Dans tous les cas si index.php se trouve entre localhost et le reste du lien pour accéder à mon panier ou compte pas de soucis, de même avec index_dev.php

J'ai bien vidé le dossier cache ...

Quelqu'un saurait il/elle orienter mes investigations ?

Last edited by AnTeBiOs (28-02-2017 23:41:44)

Offline


Le module rewrite de ton apache est-il activé ?

La configuration de ton Vhost permet-il la surchage de fichiers ".htaccess" ?

<Directory /var/www/html/Distillerie5/web>
    AllowOverride All
    ...
</Directory>

Offline


Vérifie aussi dans le back-office -> Configuration -> Gestion des variables que la variable rewriting_enable est bien à 1


OpenStudio Toulouse

Offline


Bonsoir,

merci pour votre aide !!

Y'a du mieux ... tous mes liens s'affichent correctement, ça le fait ! Par contre maintenant depuis Firefox quand je saisi http://localhost, il me fait un Redirecting... et me renvoie sur : http://localhost/web
Et m'affiche une jolie page 404 bien mise en forme alors qu'avant non. Si je remplace /web par /index.php tout va bien ...
J'avoue être confu car dans chrome ça roule, pas de soucis
Bien entendu j'ai pris soin de vider mon cache.

J'ai checké ma config Vhost :

<VirtualHost *:80>

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html/Distillerie5/web

	<Directory /var/www/html/Distillerie5/web>
		AllowOverride All
	# on apache 2.2 use :
    # Order allow,deny
    # Allow from all
        
    # on apache 2.4 use :
    Require all granted
    </Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# Custom log file
	Loglevel warn
    ErrorLog /var/log/apache2/Distillerie.error.log
    CustomLog /var/log/apache2/Distillerie.log combined

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Mon .htaccess :

Options +FollowSymlinks -Indexes

AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
    RewriteEngine On

    # SEO, remove the subdomain www in URL
    # Exemple : http://www.yourdomain.com/contact redirect 301 to http://yourdomain.com/contact
    # To activate uncomment the following two lines
    #RewriteCond %{HTTP_HOST} ^www.yourdomain.com$
    #RewriteRule ^(.*) http://yourdomain.com/$1 [QSA,L,R=301]

    # SEO, add the subdomain www in URL
    # Exemple : http://yourdomain.com/contact redirect 301 to http://www.yourdomain.com/contact
    # To activate uncomment the following two lines
    #RewriteCond %{HTTP_HOST} ^yourdomain.com$
    #RewriteRule ^(.*) http://www.yourdomain.com/$1 [QSA,L,R=301]

    # SEO, to avoid duplicate content with index.php in url
    # Exemple : http://www.yourdomain.com/index.php/contact redirect 301 to http://www.yourdomain.com/contact
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteRule (.?)index\.php/(.*) /$1$2 [R=301,NE,L]

    # If thelia is installed in a subdirectory (e.g., thelia2)
    # define the RewriteBase below to get a proper URL rewriting
    # RewriteBase /Distillerie5

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php [QSA,L]
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
</IfModule>

rewriting_enable est bien à 1 .

url_site est sur http://localhost

Je ne comprends pas hmm

Offline


Fiorefox "mémorise" en quelque sorte les redirections pendant une session. As-tu essayé de le fermer complètement, puis de réessayer ?


OpenStudio Toulouse

Offline


Merci pour la piste !!

C'est ok smile