Relative links in php file not working anymore



  • With new version of vivaldi (and chrome) in Windows 10, php files that were formerly working correctly for years and years are not working correctly any longer. Relative links are adding the *.php file itself to the link. For example at awebsitename.com/filename.php, if there is a link in the php file such as
    <img src="piano/images/pianosketch4.jpg"> instead of going to piano/images/pianosketch4.jpg, and displaying this image, what is happening is vivaldi is linking to a (nonexistant) image at filename.php/piano/images/pianosketch4.jpg.
    So no image is displaying. Same thing with links to other files. Vivaldi throws in filename.php where previously it wasn't doing that. To make my php files work i would have to go through all of them and change all the relative links to absolute links. Vivaldi is still parsing html files correctly. Chrome has the same problem. In newest version of vivaldi in my windows 7 computer, things are working correctly.


  • Moderator

    @nomenclator I fear your PHP file has a bug or your server has a broken configuration.

    I checked this PHP file on my local and remote webservers

    <?php 
    echo " ";
    ?>
    <html>
    <body>
    <img src="piano/images/pianosketch4.jpg">
    

    opened it by https://myserver1/filename.php
    and it fetched the image from
    https://myserver1/piano/images/pianosketch4.jpg


  • Moderator

    @nomenclator Perhaps you have a BASE element in HTML code which tells the browser the path to use to build a relative URL.
    Or a wrong redirect in your PHP/server settings for some non-php URLs.
    Please show me such URL or the code of the PHP.



  • Things work correctly in windows 7 and in windows 10 they work correctly in Edge and internet Explorer. Only chrome and vivaldi in windows 10 have the problem.
    http://shakahara.com/pianopitch2.php
    Also if I move the pianopitch2.php file to a subfolder and adjst the links to subfolders of that, things work correctly. It is only when pianopitch2.php is in the public_html folder that things don't work. Web site on shared hosting, is being hosted by jumpline.com.



  • After many hours, problem seems to have fixed itsefl. I did send a message to jumpline's support people a few minutes ago.



  • Jumpline said they reverted the php version back to 5.4. After that I went to cpanel and changed the php version to latest version they had, 7.2, and my php program continued to work properly. So I don't know why but 2 of my message board stopped working with php ver 7.2. Maybe i just need to update the message board, which I have been neglecting to do for a long time.


  • Moderator

    @nomenclator So it is a hoster problem, not a Vivaldi bug.
    I will move the thread.



  • @Gwen-Dragon Yes looks like its a hoster misconfiguration. I originally put the message in the Vivaldi message area, erroneously, because I had observed that the problem had occured in vivaldi and chrome, but not in edge or internet explorer. I couldn't figure out if was a vivaldi bug or a php bug so at about the same time I also sent a support request to the hosting company. By the time I wrote the messages I had already spent about 4 hours playing with the php file and looking at web pages returned by searching in google.com for "relative links in php file not working anymore"


  • Moderator

    @nomenclator I am a webdeveloper, server admin and IT gal. So i know what may happen to webservers or on hosting services.

    Fortunately the issue was solved for you. 🙂

    because I had observed that the problem had occured in vivaldi and chrome, but not in edge or internet explorer

    I do not know why it worked in Mozilla and Microsoft browser, may be old data was in browser's cache?



  • @Gwen-Dragon Well, I multiple times hit the reload button or the F5 key in each browser. My understanding is that is what you do in order to make sure the page is coming anew from the server, rather than from the web browser's cache that is on my computer. No? Also worked in Vivaldi and Chrome on my other computer, my Windows 7 computer. I updated Vivaldi on that computer and the page still displayed correctly.


  • Moderator

    @nomenclator On Vivaldi F5 reloads from cache and it depends on server's caching and expiration setting when a new page will be loaded by browser.
    Ctrl+F5 will reload without cache.


Log in to reply
 

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.