{"action":"created","issue":{"url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/323","labels_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/323/comments","events_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/323/events","html_url":"https://github.com/BrowserSync/browser-sync/issues/323","id":48208144,"number":323,"title":"Using 'browser-sync' and 'connect-modrewrite'","user":{"login":"antonioOrtiz","id":4282013,"avatar_url":"https://avatars.githubusercontent.com/u/4282013?v=3","gravatar_id":"","url":"https://api.github.com/users/antonioOrtiz","html_url":"https://github.com/antonioOrtiz","followers_url":"https://api.github.com/users/antonioOrtiz/followers","following_url":"https://api.github.com/users/antonioOrtiz/following{/other_user}","gists_url":"https://api.github.com/users/antonioOrtiz/gists{/gist_id}","starred_url":"https://api.github.com/users/antonioOrtiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonioOrtiz/subscriptions","organizations_url":"https://api.github.com/users/antonioOrtiz/orgs","repos_url":"https://api.github.com/users/antonioOrtiz/repos","events_url":"https://api.github.com/users/antonioOrtiz/events{/privacy}","received_events_url":"https://api.github.com/users/antonioOrtiz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-09T17:57:46Z","updated_at":"2015-09-30T17:55:15Z","closed_at":"2014-11-22T22:23:08Z","body":"I am working on a angular.js app. My problem is when working locally, when I refresh my URL i get `Cannot GET /` when a page is refreshed other than the index.html etc.\r\n\r\nMy problem is solved on my production server using:\r\n\r\n    <IfModule mod_rewrite.c>\r\n        RewriteEngine on\r\n        RewriteCond %{REQUEST_FILENAME} -s [OR]\r\n        RewriteCond %{REQUEST_FILENAME} -l [OR]\r\n        RewriteCond %{REQUEST_FILENAME} -d\r\n        RewriteRule ^.*$ - [NC,L]\r\n        RewriteRule ^(.*) /index.html [NC,L]\r\n    </IfModule>\r\n\r\nHowever I'd like a solution which works with gulp, locally. I have read you can use 'connect-modrewrite' like so:\r\n\r\n    gulp.task('browser-sync', function() {\r\n    browserSync({\r\n        server: {\r\n            baseDir: outputDir,\r\n        middleware: function() {\r\n            return [\r\n                modRewrite([\r\n                    '^/api/v1/(.*)$ http://localhost:3000/api/v1/$1 [P]'\r\n                ])\r\n            ];\r\n        }\r\n        }\r\n    });\r\n    });\r\n\r\n\r\nThe above doesn't work, so I assume its incorrect. Am I way off?"},"comment":{"url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/comments/144490442","html_url":"https://github.com/BrowserSync/browser-sync/issues/323#issuecomment-144490442","issue_url":"https://api.github.com/repos/BrowserSync/browser-sync/issues/323","id":144490442,"user":{"login":"borNfreee","id":3725595,"avatar_url":"https://avatars.githubusercontent.com/u/3725595?v=3","gravatar_id":"","url":"https://api.github.com/users/borNfreee","html_url":"https://github.com/borNfreee","followers_url":"https://api.github.com/users/borNfreee/followers","following_url":"https://api.github.com/users/borNfreee/following{/other_user}","gists_url":"https://api.github.com/users/borNfreee/gists{/gist_id}","starred_url":"https://api.github.com/users/borNfreee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borNfreee/subscriptions","organizations_url":"https://api.github.com/users/borNfreee/orgs","repos_url":"https://api.github.com/users/borNfreee/repos","events_url":"https://api.github.com/users/borNfreee/events{/privacy}","received_events_url":"https://api.github.com/users/borNfreee/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T17:55:15Z","updated_at":"2015-09-30T17:55:15Z","body":"@FadelChafai it does not work for me, too"}}