I'm trying to run Symfony2 application from a Apache alias /example-site/
The issue is that some of the assets get prefixed with /example-site/bundles/... while some directly start with /bundles.. and do not include the prefix.
What is the cause?
I have found that the problem was the following:
I was using asset command like this (note the / at the beggining):
<img src="{{ asset('/bundles/frontend/images/logo.png') }}" alt="">
Changed it to this solved the problem (removing / from beggining):
<img src="{{ asset('bundles/frontend/images/logo.png') }}" alt="">
So hope maybe helps someone not to lose hours looking for a solution.
Related
I'm using Nuxt 3
and this is directories structure
images are loaded like this
<img src="/images/index/pic-left.svg" />
I've also tried (start without / )
<img src="images/index/pic-left.svg" />
and it didn't worked again
What's the problem ?
In Nuxt3, the directory is now public and not static.
So it should be /images/index/pic-left.svg.
I'm working on a Vue.js project where users can download any files. Everything works fine, but for some reason, chrome doesn't download jar/zip files. There are any errors in chrome console. Moreover, it works on my local machine and doesn't work on production server. Here is vue.js code:
<a
:href="file.path"
target="_blank"
class="icon-link block q-pr-xs"
>
<q-icon name="get_app" size="sm"></q-icon>
</a>
and generated html
<a data-v-52d0018a=""
href="http://myserver.com:9000/portal-fileuploader/static/file.rar"
target="_blank"
class="icon-link block q-pr-xs">
<i data-v-52d0018a=""
aria-hidden="true"
role="presentation"
class="material-icons q-icon notranslate">
get_app
</i>
</a>
I don't even know the direction of research, so will be grateful for any ideas.
Starting from Chrome 83 version, browser blocks downloading insecure files on HTTPS.
link: https://www.chromestatus.com/feature/5691978677223424
I want to use images from my shopify theme's assets folder in a custom .js script. (product-customizer.js added last in the following section)
In my template's liquid file i have:
<script>
var woodImageAsset = "{{ 'wood.jpg' | asset_url }}";
var ajaxLoaderAsset = "{{ 'ajax-loader.gif' | asset_url }}";
</script>
<script src="{{ 'uploadcare.full.min.js' | asset_url }}" defer="defer"></script>
<script src="{{ 'fabric.min.js' | asset_url }}" defer="defer"></script>
<script src="{{ 'product-customizer.js' | asset_url }}" defer="defer"></script>
I've been able to use every asset accept for wood.jpg just fine.
In product-customizer.js when i try to print the asset URLs from the CDN i get:
console.log(woodImageAsset);
//cdn2.shopify.com/s/files/1/0257/3995/2207/t/1/assets/wood.jpg?1012
console.log(ajaxLoaderAsset);
//cdn2.shopify.com/s/files/1/0257/3995/2207/t/1/assets/ajax-loader.gif?1012
Only wood.jpg is not found.
Note that ajax-loader.gif has already been included in the theme, while wood.jpg is aditionaly added in the theme's assets folder. Is there any special way to upload image assets to a shopify theme or am i missing something else?
If you navigate to assets and examine the files, if you do not see wood.jpg then that means it is not available in that version of the theme. Simply grab a copy from another version of the theme where it is available, or upload it from your hard drive.
The other way to deal with images across all themes would be to upload the image as a file in the shop Settings -> Files section of your shop.
The NPM modules needed for my aboutus.html page cannot be found and I get a 404 error. Everything works perfectly for index.html though.
I looked into NPM server and the parsed path seems to be wrong:
19.01.20 22:33:07 304 GET /index.html
19.01.20 22:33:07 404 GET /aboutus.html/node_modules/bootstrap/dist/css/bootstrap.min.css
This is from the Chrome inspector:
http://localhost:3000/aboutus.html/node_modules/bootstrap/dist/js/bootstrap.min.js net::ERR_ABORTED 404 (Not Found)
This is the path that I have in my code:
<link rel="stylesheet" href="node_modules/bootstrap/dist/js/bootstrap.min.js">
The aboutus.html page is located in the root of my folder so what I don't understand is why NPM is adding aboutus.html/ in front of my path. This doesn't happen for the index.html.
I already tried adding / and ../ in front of my paths but to no success.
Please bear with me since this is my first question here and I am also new to the web development field. Thanks!
Place a / in front of your paths. By default, the path is resolved relative, which in this case is after your *.html file. A / causes the path to be resolved absolutely to your server root.
On index.html, the URL is usually entered as .../, not .../index.html, which would have the same behavior.
<link rel="stylesheet" href="/node_modules/...">
I solved it. The problem was in linking the wrong way from the index.html page to the aboutus.html page.
This is the way it was linked before:
<a class="nav-link" href="./aboutus.html/">About</a>
This is what I changed the line to:
<a class="nav-link" href="aboutus.html">About</a>
I hope this will help for people who will encounter the same issue.
I have the following img tag :
<img class="logo" src="../../assets/logo/logo_blue.png">
project structure
I don't know why but I only get the following error message:
GET http://localhost:8080/assets/logo/logo_blue.png 404 (Not Found)
try <img class="logo" src="#/assets/logo/logo_blue.png">
here '#' refers to root directory
will this work?
<img class="logo" src="./assets/logo/logo_blue.png">
I believe the path to that image entirely depends on the relative path between the page and image at deployment time. If you're not using HTML5 history mode, this ./assets/ prefix should always work.