diff --git a/js/ditto.js b/js/ditto.js
index f6ddc59..e03d8e8 100644
--- a/js/ditto.js
+++ b/js/ditto.js
@@ -28,7 +28,7 @@ var disqusCode = '
留言
'
var disqus_identifier=location.hash;
var disqus_title;
-var disqus_url='http://'+location.host+'/'+location.hash.replace("#", "");
+var disqus_url='http://'+location.host+'/'+location.hash?location.hash.replace("#", ""):'index';
function initialize() {
// initialize sidebar and buttons
@@ -196,7 +196,7 @@ function router() {
}
window.disqus_identifier=location.hash;
- window.disqus_url='http://'+location.host+'/'+location.hash.replace("#", "");
+ window.disqus_url='http://'+location.host+'/'+location.hash?location.hash.replace("#", ""):'index';
// otherwise get the markdown and render it
var loading = show_loading();