Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When uploading to my server: Clicking on links changes the URL, but typing the URL goes to 404 #3

Open
PushkaCom opened this issue Apr 22, 2015 · 1 comment

Comments

@PushkaCom
Copy link

Hi , when I download and upload the Router Demo , I can get to a page via link, but not through the URL - am I missing something?

Home
http://test7.pushka.com/
Click Notes
http://test7.pushka.com/notes

paste in the link and press enter
http://test7.pushka.com/notes

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

How would I get URLs working?
Do I need to link incoming URL requests to index.html or something?

//EDIT//

(this is talking about the router I linked to)

Ok - I found that for testing it is run on a Node.js server,

// let pushState and the router do the navigation. return index.html for all non-static-content routes.
app.get('*', function(req, res) {
res.sendFile(__dirname + '/index.html');
});

so all traffic goes through index.html and it serves the right files accordingly

How would this work on an apache server?
still using a JS file?
.htaccess rewriting?

@PushkaCom
Copy link
Author

Ahg, I found something - a .htaccess solution

Options +FollowSymLinks IndexIgnore _/_ RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.html

found it here:

https://gist.github.com/rayfranco/3211654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant