Ember newbie here. I am trying to host the apple-app-site-association file in our s3 instance and am not sure how to do it.
We have a website and a web application written in Ember. Like mysite.com leads to the site and mysite.com/app leads to the app.
The apple-app-site-association file needs to be in the root of the domain so when I invoke mysite.com/apple-app-site-association, I should be able to download the file. When I try adding the file to the public folder of the website and try to access it, the web app's 404 route is triggered.
So when I try to reach mysite.com/apple-app-site-association the url changes to mysite.com/app/apple-app-site-association and it says page not found.
The website itself doesn't have a redirect. Only the web app has the redirect so am not sure why it is triggered. Am new to Ember so am sorry if it is something obvious.
Related
If I try mywebsite.com/NON-EXISTENT-PATH for my site on Google App Engine, I get a 404 response.
However using create-react-app's local development server for another app, if I try localhost:3000/NON-EXISTENT-PATH, it just gives me the response for localhost:3000, rather than a 404. This also applies to hosting the app on ZEIT Now. Why is this?
Create React App is auto-detected and a wildcard route is added so that any path that doesn’t match a static file will serve /index.html.
https://zeit.co/docs/v2/build-step#optimized-frameworks
This is necessary for frameworks that don't create HTML files for each page but instead create a single index.html file and use JavaScript to route on the frontend.
This pattern is typically called SPA.
I am about to deploy a React app using react-router in our intranet. I am using Kestrel without a reverse proxy.
When I start browsing the site by typing https://myserver/, the page gets served and I can click links which take me to https://myserver/subpage, but subpage does not exist inside wwwroot, only react-router uses this to determine the contents to display. Now if the user presses the browser's reload button, a 404 is returned.
Should I configure Kestrel to serve index.html in case the requested resource is not found? If so, yes? Or is there a more elegant solution?
In my webpack config I have the publicPath set like so:
publicPath: '/js'
This way it points to public/js. Also in my index.pug file, which is loaded by the server and not in the public folder I have this:
extends layout
block content
main#app
script(src="/js/bundle.js")
Unfortunately, this enables people accessing my site to visit example.com/js/bundle.js. Is there a way to prevent this?
If /js/bundle.js is a script file you are using in your web page, then there is NO way to prevent the browser from going directly to http://example.com/js/bundle.js. That's the exact URL that the browser uses to load the script from your web page so that URL has to work.
ALL Javascript that runs in your web page is openly available to the public. You cannot change that. That's the architecture of the web and browsers.
Unfortunately, this enables people accessing my site to visit example.com/js/bundle.js. Is there a way to prevent this?
No. You cannot prevent it.
We need to deploy two different Angular5 project on Amazon S3, like
/assets (folder)
/index.html
/clients (another Angular5 folder)
/clients/assets (folder)
/clients/index.html
For example my domain is https://example.com
Now, When we try to access root index.html files with https://example.com, it is working fine. but, When we trying to access https://example.com/clients, it returns an error "Error: Cannot match any routes. URL Segment: 'clients'"
One more thing, We have setup 403 redirection on rootpath index.html, because we need to access login page when customer directly hit URL : https://example.com/login
So, When I am trying to access https://example.com/clients, it is automatically redirected on https://example.com
Could anyone please help me on this?
The project should be built with this command:
ng build --base-href /clients/
Option base-href indicates that, you what is before the Angular routes.
On the other hand, it's posible you need something like nginx in your server that redirect the request to different projects.
I am facing strange problem. On my development environment (homestead) everything is working fine as I created virtual directory in nginx. But this app needs to be installed under subdirectory of apache root directory in production.
When I secure controller with middleware ("auth), it redirects to login page correctly. When I enter credentials, it redirects to "http://example.com/auth/login". I am not sure whats going wrong with it. I tried all options including changes in .htaccess as suggested in other posts but none is working.
Auth views have hardcoded URLs in them and they are causing these issues.
Go to "resources/views/auth/login.blade.php" and change
action="/auth/login"
with
action="{{ url('auth/login') }}"
Do the same for every action and href attributes throughout the "resources/views/auth" directory.