12

I have a problem with tinyMCE but only on live environment from some reason tinyMCE rewrite absolute url and only for some TLD sites, so far I'm notice that it doesn't work for .eu domains, does someone hade a same problem or know what can fix this?

vaske
  • 9,332
  • 11
  • 50
  • 69

6 Answers6

16

We needed to set both of these options in order to get TinyMCE to stop rewriting URLs to relative paths.

relative_urls : 0
remove_script_host : 0
jasonbar
  • 13,333
  • 4
  • 38
  • 46
5

Although this question has already been answered. I have my own solution and it could be helpful to some others if the accepted answer does not work.

Please see link below for more info.

tinyMCE.init({
    ...
    convert_urls: false,
});

https://www.tiny.cloud/docs/configure/url-handling/#convert_urls

Achmed Zuzali
  • 883
  • 10
  • 12
3

Am I the only person that finds the TinyMCE relative_urls option confusing ?

If you're writing an article/blog post and want to include a ink to a web site other than one you're on, I think the term "absolute URL" describes what you want. You want to put "http://www.somesite.com" and not have TinyMCE put either a forward slash '/' or a relative path '/mysite/' in front of it.

Surprisingly, if you set the following :

tinyMCE.init({
        ...
        relative_urls : false
});

then that's exactly what TinyMCE does :(

But, if you do this :

tinyMCE.init({
        document_base_url : "http://www.somesite.com",
        relative_urls : true
});

Then you seem to get plain, unadulterated links.

Go figure.

Grindlay
  • 571
  • 5
  • 8
0

I ran into some similar problems with tinyMCE before. It has some strange default behavior with URLs. There are a number of initialization properties you can set that effect how it behaves. Take a look at the documentation and experiment with these properties. At least that's what I did and eventually got the behavior I wanted.

Good luck!

Jai
  • 366
  • 2
  • 8
0
relative_urls: false,
remove_script_host: false,

That will result with URL like http://www.youpage.com/subfolder/file/etc

d78
  • 1
  • 1
0

You can do this

tinyMCE.init({
        ...
    relative_urls : false,
    remove_script_host: true,
});

for more details https://www.tinymce.com/docs/configure/url-handling/#remove_script_host

Sarath Ak
  • 7,903
  • 2
  • 47
  • 48