Mapping URIs not working

Hi, I am trying to map URIs in Komodo Edit (10.2.2) without much success. Here is what I am doing:
In preferences I select Mapped URIs then I select plus and I put file:///C:/Network/Apache24/htdocs/ for the “URI” and I put http://localhost/ for the “Maps to”. I would assume that every time Komodo encounter the URI, it would swap it to the Maps to target - but it does not. When I manually change the two above mentioned snipets in the browser everything works fine. All the files I am working on will be in this directory and I would like this to be fixed in preferences because changing it every single time in the current file preferences is hardly convenient (but it does work). What am I doing wrong? The similar posts I have seen do not seem to fix my problem.

Can you explain what you mean here? What exactly are you doing? As far as I know, where Mapped URIs are used it’s working fine. I was using it recently for Remote Debugging.

  • Carey

HI, thanks for getting back to me. I do not know if I am getting this right but since I mapped “file:///C:/Network/Apache24/htdocs” to “http://localhost/” I am assuming that if I am trying to preview a file in C:/Network/Apache24/htdocs/blablabla/blamore/myfile.html Komodo will swap it to http:/localhost/blablabla/blamore/myfile.html which would do exactly what I need to do in order for everything to work properly without cross-scripting errors. Am I understanding this right or have I got this all wrong?

@hobbes2602, the URI is http://localhost. That seems to be your issue. It’s working just fine for me when using Browser Preview.

It’s a confusing dialog, I know. I believe we have an enhancement request to make it more straight forward.

  • Carey
1 Like

Hi Carey, Still not working for me. I put http://localhost in the URI and C:/Network/Apache24/htdocs in Maps to and when I do a preview it still shows: file:///C:/Network/Apache24/htdocs/… I.e. it does not do the mapping to the localhost. I’ll try to see if i can find an editor that can show my programming work directly in localhost.

That’s not a Windows path. That’s a Windows path trying to be a Linux path. Try appending file:/// to that like you were doing before.

  • Carey

@hobbes2602, Use the Local or Remote buttons to set the Maps To field. In your case you will use Local.

  • Carey

Oh sorry, NVM. Just do a normal Windows path I guess. This is what mine looks like that is working.

  • Carey

Hi, thanks for guiding me through this. I have done exactly as what you showed me (been very careful for any typos) and it still does not do the conversion. Do I have to change anything into the Web & browser segment - as of now it is set as: preview in externeal browser (specified as chrome). The settings a little below is set to: Direct connection to the internet.
P.S. I type C:/Network/Apache/htdocs in the box and when I consult the list of Mapped URIs, the system appends file:/// in front of it.
Still cannot get this to work.

The only difference I see is that you’re still typing the path as a Unix style path (ie. using / instead of \). Try using the Local button to choose the path instead of typing it manually. Let’s eliminate as many chances of as possible :slight_smile:

If it’s still not working then try Help menu > Troubleshooting > Restart in Safe-Mode, setup the Mapped URI again and try Browser Preview. If you could provide screenshots of your configured Mapped URI that might help.

You don’t need to set browser settings. When you click the Browser Preview button in the Dynamic toolbar you should see the fixed URL instead of the system path. See my gif below.

  • Carey

Hi Carey, I managed to get it to work. To tell you the truth I do not know what went wrong where. So what I did, I erased my profile completely. Then I set it up as you said (did that before but it did not work) With the profile erased, it worked but for other users reading this, be mindful that there should be no forward slash after localhost and similarly there should be no slash (back/forward) after the entered path. (in one intermediate trial I did this wrong and localhost was merged with the path with a slash missing). I am quite happy to have sorted this out. Thanks very much Carey for your patience through this. Hopefully this post might be of help to others. Best, E