tinyMCE converts relative urls to absolute

tinyMCE converts relative urls to absolute

by yuki yuki -
Number of replies: 10
Version Moodle 1.9

When I enter a relative url TinyMCE converts it to an absolute one.
How can I disable this? Please help:
example: suppose

If I type url like below:
src="/mysite/file.php/1/homepageicon/whatisthiswebsitefor.png

then save it...its ok but when I again open it in html code [click toggle html mode from above bar] mode above becomes automatically like below:

src="http://mysite.com/mysite/1/homepageicon/whatisthiswebsitefor.png

This portion [http://mysite.com/] automatically added.

but I want it should be kept like relative url meaning it should not change.
Please help me.
Average of ratings: -
In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Why do you think a relative URL is better?

Really, just don't worry about it.

In reply to Tim Hunt

Re: tinyMCE converts relative urls to absolute

by yuki yuki -
The reason is I have a moodle website which has two url. One is accessible from IntErnet(https) and other url is for IntrAnet(http). So If I link an image using absoulte url(suppose internet url) then If I browse it from IntrAnet url then the images or link is not working. Hope you understand. thats why relative is better in this situation but tinymce automatically adding url. Can u pls help me?
In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Many things in Moodle won't work if you try to set up one Moodle site with two different URLs.

Instead, you should configure your DNS/network, so that wherever they are, people use the same URL to access Moodle.

In reply to Tim Hunt

Re: tinyMCE converts relative urls to absolute

by Logan Modine -

I also use multiple installs of Moodle and am annoyed with tinyMCE rewriting my code.  The spell checker also doesn't work for tinyMCE which is a big problem with language learning.

In reply to Tim Hunt

Re: tinyMCE converts relative urls to absolute

by yuki yuki -
But I have to setup two different urls. Because one audience cannot access Internet(but they can use intranet through VPN) and other audience can access Internet. But I should keep the website one.

>Many things in Moodle won't work
But I see everything is working fine. Could you please kindly clarify whats that many things?

>Instead, you should configure your DNS/network, so that wherever they are
As I said if i redirect through DNS but if one audience cannot access Internet there is no meaning of redirection.(In opposite way another audience cannot access Intranet)
In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Your server may require two different IP address when accessed from the public internet, and when accessed from your own network, but if so, there is no reason to expose users to that implementation detail.

On the internet, there is a system (DNS) for converting symbolic names like my.moodle.site to the appropriate IP address.

On your internal network there will be some way of resolving nice human-readable names like my.moodle.site into the correct IP address (or other routing address).

What you should do is use the same nice human-readable name like my.moodle.site (or whatever your domain name is) on both sides of the network.

I did not suggest that you route internal users via the internet.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: tinyMCE converts relative urls to absolute

by yuki yuki -
Anyway my problem is with tinymce not the DNS or IP address.
I have found that only IE cause problem but other browsers are ok.
Dont know why IE. If you have any idea you can share. Thanks for your input so far.
In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It is not just TinyMCE. Many parts of Moodle assume they are dealing with absolute URLs. Expect occasional problems if you try to use relative URLs.

In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

Yuki

You should not need tinymce to do this.  Turn the html editor off in your profile. If you are determined to make a bad network set up work, you should be prepared to code all the html by hand.  If you can not do this, then you will certainly not be able to deal with the difficulties that arise in Moodle due to relative links.

Tinymce is not intended to help administrators to do crazy things. It is there to defend novices from themselves.

Average of ratings: Useful (1)
In reply to yuki yuki

Re: tinyMCE converts relative urls to absolute

by Yang Yang -

Hi Yuki

I got the same problem with the TinyMCE. It converts to absolute urls in all the browsers I tried (Chrome, FF and IE). Have you found a way to use relative path in the TonyMCE?

 

Cheers

Yang