0

I have a Jquery slideshow generator that writes/reads tags using this src=images/image1.jpg rather than src=/images/image1.jpg NOTE: the /. In the htaccess rewrite, it requires the src to have the backslash / before the folder named images or else, the rewrite causes a 404 error when fetching images in that folder causing the server to respond with the error page.

When i check the firebug console i see SyntaxError: expected expression, got '<'. Caused when the javascript that was requesting the GET for the image gets the error response page as its input instead of the image it expected to load.

One solution is to ensure src=/images. That / has to be there. If i change to that in the html file, the Javascript slideshow generator fails. It quickly becomes a catch22. I have convinced myself i HAVE TO SOLVE IT in htaccess? If so, how? OR Is there any other solution?

Dudus
  • 25
  • 8
  • here you need to read :), https://stackoverflow.com/questions/2005079/absolute-vs-relative-urls regards. –  Sep 23 '17 at 22:24
  • Write acces to your image like this src="/image/myimage.png" here relative "/" is the root www/ or www/public/ . –  Sep 23 '17 at 22:54
  • If i write like that, the slider code breaks. Slider code wants src tag without backslash so i'm forced to find another workaround. – Dudus Sep 24 '17 at 10:14
  • Hi, only the slide got this problem? Because is no a hard way to adapt slider and hard coded to match the good URL. Now i suggest to paste the problem code because we can help on JavaScript way without any code here, and the root folders architecture you got. Regards. –  Sep 24 '17 at 10:21
  • SOLVED. The slider was requesting for the file http:/cdn.server2en.com/scripts/4.0/jquery-1.8.3.min.js via http. BUT i have redirected http requests to my server root(which doesn't have the script),
    So rather than a script, the server was returning a webpage which like all valid webpages begins with a'<'. Which I simply bypassed the redirection, downloaded it, created the necessary folder/file structure at the server root, now the script exists at root. When redirection happens it now gets the file at http://192.168.8.1/scripts/4.0/jquery-1.8.3.min.js
    – Dudus Sep 24 '17 at 11:05
  • Good :) gl for the next ;). –  Sep 24 '17 at 11:15
  • Thanks for triggering the right process. it started with me looking for the file to post it to you, then i discovered i couldn't find it then. . . – Dudus Sep 24 '17 at 11:27
  • Welcome, yes i am a new member i dunno how to send too private message or invite someone to the chat... i need to take a look on that ;). Regards. –  Sep 24 '17 at 11:48

0 Answers0