As it was previously pointed out, this the correct way:

relative_urls : false,
remove_script_host : false,
convert_urls : true,

HOWEVER, there is one thing to mention that will make you wonder why it's not working even though you have specified the proper text above. Ensure the false and true do NOT have quotes around them.


Tiny Mce Image Upload with Full URL

Full TinyMCE Code :

	selector: '#mytextarea',
	height: 400,
	theme: 'modern',
	plugins: [
	'advlist autolink lists link image charmap print preview hr anchor pagebreak',
	'searchreplace wordcount visualblocks visualchars code fullscreen',
	'insertdatetime media nonbreaking save table contextmenu directionality',
	'emoticons template paste textcolor colorpicker textpattern imagetools codesample '
	toolbar1: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
	toolbar2: 'print preview media | forecolor backcolor | emoticons | codesample ',
	images_upload_url: 'upload.php',
	image_advtab: false,
	relative_urls : false,
	remove_script_host : false,
	convert_urls : true,
	images_upload_handler: function (blobInfo, success, failure) {
		var xhr, formData;
		xhr = new XMLHttpRequest();
		xhr.withCredentials = false;'POST', 'upload.php');
		xhr.onload = function() {
			var json;
			if (xhr.status != 200) {
				failure('HTTP Error: ' + xhr.status);
			json = JSON.parse(xhr.responseText);
			if (!json || typeof json.location != 'string') {
				failure('Invalid JSON: ' + xhr.responseText);
		formData = new FormData();
		formData.append('file', blobInfo.blob(), blobInfo.filename());
	codesample_languages: [
	{text: 'HTML/XML', value: 'markup line-numbers'},
	{text: 'JavaScript', value: 'javascript'},
	{text: 'CSS', value: 'css'},
	{text: 'PHP', value: 'php line-numbers'},
	{text: 'Ruby', value: 'ruby'},
	{text: 'Python', value: 'python'},
	{text: 'Java', value: 'java'},
	{text: 'C', value: 'c'},
	{text: 'C#', value: 'csharp'},
	{text: 'C++', value: 'cpp'}
	content_css: [



Upload File Code :



// Allowed origins to upload images
$accepted_origins = array("http://localhost","");

// Images upload path
$imageFolder = "../../uploadimages/";

$temp = current($_FILES);
		// Same-origin requests won't set an origin. If the origin is set, it must be valid.
		if(in_array($_SERVER['HTTP_ORIGIN'], $accepted_origins)){
			header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
			header("HTTP/1.1 403 Origin Denied");
	// Sanitize input
	if(preg_match("/([^\w\s\d\-_~,;:\[\]\(\).])|([\.]{2,})/", $temp['name'])){
		header("HTTP/1.1 400 Invalid file name.");
	// Verify extension
	if(!in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), array("gif", "jpg", "png"))){
		header("HTTP/1.1 400 Invalid extension.");
	// Accept upload if there was no origin, or if it is an accepted origin
	$filetowrite = $imageFolder . $temp['name'];
	move_uploaded_file($temp['tmp_name'], $filetowrite);
	// Respond to the successful upload with JSON.
	echo json_encode(array('location' => $filetowrite));
} else {
	// Notify editor that the upload failed
	header("HTTP/1.1 500 Server Error");