• Resolved rajendrapopuri05

    (@rajendrapopuri05)


    Hi,
    I am seeing few absolute URL’s in the browser view page source after activating the Make Paths Relative plugin.

    <link rel=”alternate” type=”application/json+oembed” href=”https://<hostname&gt;:<port>/blog/wp-json/oembed/1.0/embed?url=%2Fblog%2F” />
    <link rel=”alternate” type=”text/xml+oembed” href=”https://<host&gt;:<port>/blog/wp-json/oembed/1.0/embed?url=%2Fblog%2F&format=xml” />

    Also in the Java Script functions
    url: ‘https://<hostname&gt;:<port>/blog/wp-admin/wordpress/wp-admin/admin-ajax.php’,
    I am using ajax for my blog.

    Please advise, how can I make them relative URL’s.

    Thanks,
    Rajendra

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi Rajendra,

    You are seeing these URLs as they have been hardcoded in the theme. Plugin only make the URLs to be relative those who have been attached by WordPress hooks like get_post, wp_enqueue_script etc.

    So, the URL which has been hardcoded in the HTML that won’t be removed as per current version. but in coming version that would also be converted into relative by reading the URLs in HTML.

    Thanks,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami, the code used in the themes funtions.php is as below.

    <script type=”text/javascript”>
    function fetchsearchresults(){
    if(jQuery(‘#keyword’).val().length > 3){
    jQuery.ajax({
    url: ‘<?php echo admin_url(‘admin-ajax.php’); ?>’,
    type: ‘post’,
    data: { action: ‘data_fetch’, keyword: jQuery(‘#keyword’).val() },
    success: function(data) {
    jQuery(‘#search_results’).html( data );
    jQuery(‘.search_nav’).fadeIn();

    }
    });
    }

    }
    </script>

    This is causing absolute URL’s are appearing in the java scripts functions in view page source as below.
    https://<hostname&gt;:<port>/blog/wp-admin/wordpress/wp-admin/admin-ajax.php’,

    Please let me know any changes required to it in order to make urls’ relative by the plugin. Thanks in advance.

    Rajendra

    Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi Rajendra,

    Plugin doesn’t works on admin_url(‘admin-ajax.php’); at the moment. I’ll check this function and check whether i can add the filter which makes this path to be relative or not.

    Thanks,
    Sami

    Thread Starter rajendrapopuri05

    (@rajendrapopuri05)

    Hi Sami,

    Thanks for your reply.
    Is any alternate way to use admin-ajax.php file? so that hostname and ports can be hidden in the view-page source. Please advise.

    Thanks,
    Rajendra

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Absolute URL’s are appearing in the browser view page source’ is closed to new replies.