Jump to content

relative url = f'd up images. absolute url = f'd up images. So what else?


Recommended Posts

I had problems with HTTPS with images being served up as HTTP and the "answer" on the forums was to switch all my CMS (etc) url's to relative.  Ok... fine, but then when an image is served up in a category page (ie. one step down on the hierachry) then the image is error 404 not found, of course.

Answer to that?  According to the forums, the answer is to use absolute url.

WTF

 

Seriously... how do I input links in my product pages, CMS pages, etc so that

 

 

#1)  They show up no matter if the user is on the main page, a product page, or a multi-level product pages.

#2)  They are served up with HTTP or HTTPS as needed

 

????

 

Once again, I wait in vein for support.

Link to comment
Share on other sites

A relative path in your cms pages should start with / and this is considered relative to the domain, if your base uri is another folder, that should also be included in the path.

In conclusion all your links should start with the Base URI (BO > Preferences > SEO & URLs).

Let's say you have prestashop installed on www.example.com, a image link will look like: /img/cms/cms-img.jpg

If you have prestashop installed on a subfolder like www.example.com/mypresta/, the image link will look like: /mypresta/img/cms/cms-img.jpg

Link to comment
Share on other sites

How do your urls look like at the moment?

umm... as I wrote above. What do you mean, how do they look?

 

A relative path in your cms pages should start with / and this is considered relative to the domain, if your base uri is another folder, that should also be included in the path.

In conclusion all your links should start with the Base URI

You just concluded with the opposite of your preceding instruction.

 

Starting with / doesn't work. That's what I was doing until I saw tinymce rewriting the url to either ../ or absolute as per setting. I can turn rewriting off, but that is advised against in several forum posts, and frankly if that is necessary then this should be considered a bug.

Link to comment
Share on other sites

Starting with / doesn't work. That's what I was doing until I saw tinymce rewriting the url to either ../ or absolute as per setting.

 

I actually don't let tinymce to adjust my paths. I use the source code button to adjust all the paths manually as I described in my previous post.

Link to comment
Share on other sites

If you haven't edited your .js specifically, then you're wrong on that.  Editing with the source code button changes nothing.  It re-writes, by default, what you enter upon save regardless of what mode you were in when you entered it.   It cleans the HTML, strips away a lot of things... and "corrects" your URLs.  If you have edited your .js config script to disallow url rewriting then that's different (but something you should mention when giving such advice).  Again, I've seen several posts warning against doing that.

Link to comment
Share on other sites

Maybe.  Hmm.

 

So you're telling me that if your domain is www.example.com and your site is in a folder called "shop" (and so your base uri is defined as www.example.com/shop) and you're editing a product description and you want to put in some photo that's located at http://www.example.com/shop/img/myphoto.jpg that you would hit the source button and type in something like this:

<img src="/img/myphoto.jpg">

and when you save it, go back in and click source again you still see above and not:

<img src="http://www.example.com/shop/img/myphoto.jpg">

or

<img src="../img/myphoto.jpg">

???

 

If that's the case, then yes perhaps something is up on my end.  I did follow someone's advice here to "extend" tinymce in order to fix some other problem I was having early on that I can't even remember now.

 

Please confirm above and then I'll do some digging.  Perhaps I'll start over (again) with a fresh copy.

Link to comment
Share on other sites

On your example, if PrestaShop is at address www.example.com/shop, that means my Base URI (at SEO&URLs) is /shop/ . To show myphoto.jpg that is in the img folder I click the source code button from tinymce and add:

<img src="/shop/img/myphoto.jpg">

And the path remains the same after I exit source code and enter again. That /shop/ at the beginning is vital for the path to work.

Link to comment
Share on other sites

I'd still go for absolute urls. If neither displays you might as well have a permission level issue, really. Just locate the image and use an absolute url.
If it doesn't work, try accessing it from the browser and see if it does

Link to comment
Share on other sites

Absolute doesn't work.  That's only a good suggestion for those not using https (which means they aren't an ecommerce shop) or they're only using https (which I rarely see done so there must be a reason not to?).  Or are you saying the site should be https only?  So the customer types in www.example.com and a redirect takes them to https://www.example.com and they stay there the whole time?  Or I'm missing something because when I tried absolute, I got security warnings on my https pages.

Link to comment
Share on other sites

I actually can't think of a reason to refute that... except that was never the recommended practice.  Most sites only use SSL for sensitive pages.  There has to be a reason for that, no?  Performance?

 

I understand your point.  But now you get more SEO juice because Google wants SSL for all pages.  Why?  My guess is because it's much more difficult to censor/block.  Remember China booted Google out by blocking them.  So this I suspect is part of reason why Google now 'loves' full SSL for all pages.  Happy day.

Link to comment
Share on other sites

  • 1 month later...

I actually have a problem with this (aside from not finding the noted settings discussed above in my shop 1.6.0.8) as my site is not showing any images on any pages that has SSL, https in the url.  I also doubt google is penalizing for this as all of the top rated sites in my industry are only using SSL on sensitive pages.

Link to comment
Share on other sites

×
×
  • Create New...