doog_2019 Posted April 6, 2019 Share Posted April 6, 2019 (edited) Hello, As I said in a previous post, I am a new user of prestashop and am building my first website. I use the last version of prestashop and I work in localhost with MAMP. My problem: All my images work perfectly on my website BUTmy header in my CMS pages works only when I desactivate URL FRIENDLY. (See the photos) What I already did: - Regenerated thumbnails - Deleted .htacess and activated again URL Friendly - Changed the path for the images in /img/cms PS: my headers are generated from my header.tpl where I added theses line: {if $page.page_name == 'category'} <img src="themes/laber_outstock1/assets/img/ban_category.png"> {/if} {if $page.page_name =='cms'} <img src="themes/laber_outstock1/assets/img/ban_test.png"> {/if} CMS PAGE WITH URL FRIENDLY ACTIVATED CMS PAGE WITH URL FRIENDLY NOT ACTIVATED (So it works) My .HTACCESS on the root looks like: <IfModule mod_rewrite.c> <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> RewriteEngine on #Domain: localhost:8888 RewriteRule . - [E=REWRITEBASE:/www/test/] RewriteRule ^api$ api/ [L] RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # AlphaImageLoader for IE and fancybox RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L] </IfModule> AddType application/vnd.ms-fontobject .eot AddType font/ttf .ttf AddType font/otf .otf AddType application/font-woff .woff AddType font/woff2 .woff2 <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> #If rewrite mod isn't enabled ErrorDocument 404 /www/test/index.php?controller=404 Thank you for your help Edited April 8, 2019 by doog_2019 (see edit history) Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 6, 2019 Share Posted April 6, 2019 Hello @doog_2019, What happens if you right click the broken image, and choose "open IMAGE in a new tab"? Link to comment Share on other sites More sharing options...
doog_2019 Posted April 6, 2019 Author Share Posted April 6, 2019 Hi @Rodrigo B Laurindo, (I am back 😂), If I open it in a new tab, there is an Error 404 and the URL is: http://localhost:8888/www/test/content/themes/laber_outstock1/assets/img/ban_test.png "La page que vous cherchez n'a pas été trouvée" means "The page you are looking for has not been found." Do not hesitate if you need more screenshots Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 7, 2019 Share Posted April 7, 2019 The url is wrong then, right? Where is your htdocs folder? Is there a www/test/content/themes/label_outstock1/assets/img/ folder in it? Link to comment Share on other sites More sharing options...
doog_2019 Posted April 7, 2019 Author Share Posted April 7, 2019 Hi @Rodrigo B Laurindo, The htdocs folder is just before "www": mamp/htdocs/www/test/content/themes/label_outstock1/....... You are right, the url seems to be wrong because there is NOT the folder "content" after the "test" one : www/test/content/themes/label_outstock1/assets/img/ban_testp.png How can it be possible ? Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 7, 2019 Share Posted April 7, 2019 (edited) Because there is a bug in your theme template. Try this: src="{$theme_dir}/laber_outstock1/assets/img/ban_category.png"> Edited April 7, 2019 by Rodrigo B Laurindo (see edit history) 1 Link to comment Share on other sites More sharing options...
doog_2019 Posted April 7, 2019 Author Share Posted April 7, 2019 Hi @Rodrigo B Laurindo It's workinggggg THANK YOU !!! So, if I understand correctly, the command "{$folder_dir}" forces the path ? Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 7, 2019 Share Posted April 7, 2019 (edited) Great 😁 No, It IS the themes path of Prestashop It returns something like: /yoursiteroot/themes Edited April 7, 2019 by Rodrigo B Laurindo (see edit history) 1 Link to comment Share on other sites More sharing options...
doog_2019 Posted April 7, 2019 Author Share Posted April 7, 2019 I see ! Thank you again 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now