diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -178,7 +178,14 @@ server.onPhantomPageCreate = function(req, res) {
                 _this.checkIfPageIsDoneLoading(req, res, req.prerender.status === 'fail');
             }, (req.prerender.pageDoneCheckTimeout || _this.options.pageDoneCheckTimeout || PAGE_DONE_CHECK_TIMEOUT));
 
-            req.prerender.page.open(encodeURI(req.prerender.url.replace(/%20/g, ' ')), function(status) {
+            var uri = encodeURI(req.prerender.url.replace(/%20/g, ' '));
+
+            //html5 push state URLs that have an encoded # (%23) need it to stay encoded
+            if(uri.indexOf('#!') === -1) {
+                uri = uri.replace(/#/g, '%23')
+            }
+
+            req.prerender.page.open(uri, function(status) {
                 req.prerender.status = status;
             });
         });
make sure we encode # (%<I>) for html5 push state URLs