laurelnaiad / angular-couch-potato

Lazy-Load and Register Components in AngularJS Applications
Other
104 stars 19 forks source link

Angular route with html5Mode giving 'Not found' page after reload in apache #4

Closed kuma0605 closed 11 years ago

kuma0605 commented 11 years ago

ui-router-sample: I make some changes in files to make it work in apache. It really works. But there is a problem when refresh page, it occurs a problem:

2013-10-20 9 59 10 pm

(except home).

I also try some changes to fix it. But may be you can give me a help quickly,If I post it here.

https://github.com/kuma0605/angularjs-ui-router-couch-potato you can clone it, put it in apache. Have a try.

laurelnaiad commented 11 years ago

I'm sorry, I'm not going to clone it and put it in Apache. It sounds like you're having trouble with your apache configuration. Couch Potato works fine in html5mode. I suggest you look at your apache configuration. Nothing about Couch Potato cares which web server you use. The samples include a simple node express server that is configured for html5 mode.

kuma0605 commented 11 years ago

I solved it. I comment baseUrl in index.html, html5mode and change templateurl in routes, and prepend "#" to all links in html. There is no need to change config in web server. That's what i want.

在 Oct 21, 2013,3:07 AM,Stu Salsbury notifications@github.com 写道:

I'm sorry, I'm not going to clone it and put it in Apache. It sounds like you're having trouble with your apache configuration. Couch Potato works fine in html5mode. I suggest you look at your apache configuration. Nothing about Couch Potato cares which web server you use. The samples include a simple node express server that is configured for html5 mode.

— Reply to this email directly or view it on GitHub.

mmahalwy commented 10 years ago

@kuma0605 you didn't solve the problem though, you just did the hash solution...

mparisi76 commented 10 years ago

The hash url is not html5Mode..

laurelnaiad commented 10 years ago

One way or the other, I think the takeaway message should be that couch potato doesn't really care about html5 mode one way or the other, and works just fine in either mode, but like the rest of angular's html5 mode, you need to configure your web server properly for it to work.

The script files should all end in .js. When I do html5 mode I just route everything that does not containa a . character to index.html and call it a day.

talhamaniar commented 9 years ago

while implementing "$locationProvider.html5Mode(true).hashPrefix('!');". When i refresh the page eg: url: localhost:8000 /project. i am getting issue in page " NOT FOUND ". Any one can help me where i am wrong..

laurelnaiad commented 9 years ago

It sounds like your server isn't properly configured for html5-mode routing.

talhamaniar commented 9 years ago

my server is working fine. i m getting the result but after reload or refresh the page it showing " NOT FOUND "

laurelnaiad commented 9 years ago

Well, yours is the classic symptom of not having configured the server properly. Please open a separate issue with diagnostic information that shows that your browser is getting the proper files from the server when you refresh if you'd like to get some help. You can easily create a capture of the initial page load that works combined with what happens when you refresh by following the instructions to create a HAR file. Thanks.