We are hosting our blog in a subdirectory (https://domain.com/blog/), not a subdomain (https://blog.domain.com). We are fetching content behind reverse proxy from server b.
Every thing is working fine but I could not make Ajax call.
This is my jquery code.
I tried:
if(window.location.href.indexOf('reallygoodstuff.com/community') !== -1) {
proxied-ajaxurl = '/community/wp-admin/admin-ajax.php';
proxied-rgsajaxcall ='/community/wp-content/themes/themefolder/js/ajax-auth.js'
var proxied-url= proxied-rgsajaxcall.proxied-ajaxurl;
}
jQuery(document).on('click', '#seemorefarvt', function(event) {
event.preventDefault();
/* Act on the event */
jQuery(this).remove();
jQuery("#hideonseemorefavt").delay(800).hide(0);
jQuery.ajax({
url: proxied-url,
type: 'post',
data: {
action: 'rgsmainjsfile' ,
query_vars: rgsajaxcall.query_vars,
},
beforeSend: function(){
jQuery("#showmessage").html('<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>');
},
success: function (html) {
jQuery("#appendfavthtml").append(html).show("slow");
jQuery("#showmessage").remove();
},
});
I get same page which i am on.
Any help will be really appreciated.