How to deploy two Angular5 project on amazon S3 - amazon-s3

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.

Related

Why does Create React App hosted on ZEIT Now not show a 404 response?

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.

How to add apple-app-site-association file to my Ember app?

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.

Laravel5 app in subfolder, authentication redirection not working

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.

serve 404 page from a folder with static files when using Joomla

I have a Joomla site running on Apache and Ubuntu 12.04. I wanted to show a custom 404 pages to be shown when a 404 error occure. I have made necessary changes to error.php file in my template directory to redirect it to '/404' directory where I have an index.html file with many images,css and java script.
Now when accessing a non-existent page, Joomla is redirecting me to root/404 but there I get a 403 Forbidden error from appache. The 404 directory is located inside 'htdocs' directory of Joomla installation.
Additional info:
1. I don't want to convert my 404 page into a Joomla template or article.
2. I am using a Joomla AMI from Bitnami on Amazon web service
If you redirect to a 404 page, you corrupt the error mechanism. The client will never get that 404 status, but a 200 on successful redirect to your error page.
Instead, you should modify your template's error.php to
send the 404 Not Found header
directly send the error page using readfile()
You might have to adjust the asset paths within your error page.
That's totally wrong, working with static pages does not mean that you have to overcome Joomla's routing.
You should either override the error Page view or use custom error pages.
Take a look at Joomla's documentation.http://docs.joomla.org/Custom_error_pages
Nibra was totally right about breaking the mechanism but still using a readfile() seems as an overkill.

I want all page requests to point to a single page

The wrinkle is that the pages being requested are aspx pages and they are no longer present. I want any request coming to the root domain (and any subdomain like www) to redirect to a single page in the root directory (namely index.html) I went into the IIS admin tool, selected the domain and tried to direct to a url (http://mydomain.com/index.html) but that caused index.html to be appended multiple times and resulted in an error.
What is the best way to do this, so that any http request ot hsi domain goes to the index.html page?
Thanks in advance.
Warren
You can achieve this using the ASP.Net App_Offline feature; if you place a file in the root of your website called App_Offline.htm, the contents of that file will be returned in response to all incoming requests.
Or find your default 404.html file and put some redirection code into it