Ajax刷新页面URL

Hi everyona i have one question about refreshing page.

I am trying to refresh my chat page. But i have one problem here. I am trying this following code for refresh

$(document).ready(function(e) {
  $.ajaxSetup({
    cache: false
  });
  setInterval(function() {
      $('#message').load('messageReply.php');
    }, 2000
  );
});

So the code is working but url is different.

I used to .htaccess for chat page like:

RewriteRule ^chat/([\w-]+)/?$ /chat.php?chat_username=$1 [L,QSA]

http://localhost:8888/chat/username

I am getting this eror from the chrome developer console:

GET http://localhost:8888/chat/messageReply.php?_=1436565112775 404 (Not Found)

Anyone can tell me how can i fix this error ?

You're using a relative URL, which the browser resolves from the path to the current page.

You want an absolute URL (starting from the domain root).

Add a / to the beginning of the URL.