where put clientaccesspolicy.xml and crossdomain.xml ? - 404 not found error - silverlight

I have Silverlight app and when I want to do some action Firebug show me that on this two files I have 404 not found error.
So should I insert this files somewhere in my solution or to IIS rootwww directory?
Or it's other solution of this error?

You should put those files in the root virtual directory of IIS, which defaults to C:\Inetpub\wwwroot\, such that the file shows up as "http://<yourdomain>/clientaccesspolicy.xml", or "http://<yourserver>/clientaccesspolicy.xml".

Related

404 connecting frontend to backend, content security policy

I have the backend server.js file in a folder labeled server alongside a client folder. I have express, cors, and nodemon installed as dependencies in the server folder, and performed a CRA to generate the front end.
However, I created an endpoint to return a json object to test if the server is working and it is not.
Step 1:
First, I attempted to set the "/" endpoint to return a res.send({message: "welcome to the server"}) and display it on the dom.
RESULT:
Cannot Get /
---In the Console of the Chrome browser I see a 404 for the path http://localhost:5000/weather although I've defined the endpoint as instructed, and in Firefox Dev Edition I see that the Content Security Policy blocked a resource http://localhost:5000/favicon
Step 2:
This lead me to attempt a HTTP response header that would include the security policy directives being violated.
Step 3:
Hereafter I learned that the diagnostics are throwing this error because servers by their nature do not serve the contents of the root directory, therefore I included a static path for the folder where that resource would be located to circumvent the cause of the 404 error. I lastly updated the file path in index.html where the /favicon.ico is being referenced and removed the %public% from its url so that it is an exact path to the public folder
Step 4:
Because the combination of configuring the Content Security Policy HTTP request header, updating the path for the server to resolve to the public client folder, and opening it in different browsers did not work. I tried one final thing that I've read from mining stack overflow: removing the devtools.JSONview.enabled from my Firefox browser. To no avail..
What could be the source of this problem? I've tried every solution ive seen so far.. is there something I've overlooked? Does Helmut really fix this issue? If so, what directive would it add that I haven't already? Please, and Thank you
Setting Response Header to include Content Security Policy with relevant directives,
Updating the file path of the favicon.ico resource and setting a static path for express to locate missing directory,
And updating browser settings in Firefox, attempted in Chrome to no avail.

Getting an "Access Denied" error when I reload my React app on AWS Amplify

I am working on a React app that's running on AWS Amplify. My React app is using the react-router-dom library to route to different components. After running amplify publish in the CLI, at the root of the app (obktraining.com) everything is fine in the browser, I can also route to other components in the app just fine as well. But when I refresh my browser while I am on a route (obktraining.com/menu), I get an Access Denied error message.
I have found other posts about similar issues regarding rewrites and redirects in Amplify, but the solutions given do not work for me.
Here is an image of the error:
My Amplify app rewrites & redirects :
Again, the error only displays when I refresh on a route (obktraining.com/menu or obktraining.com/drinks) not on obktraining.com. Is the issue being caused by the react-router-dom library or is it an issue with Amplify settings? I am not sure where to go from here.
I have been facing the same error since days.The error is being caused by the amplify settings. The solution is simple,
Edit your Rewrites and redirects by adding a new rule.
source address = </^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>
target address = /index.html
status = 200 (Rewrite)
Country code can be left blank
Save and try refreshing your app again. It should probably work.
use this for reference: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa
Then you can just put in (as Dhruv Godambe posted above)
</^((?!.(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$).)*$/>
as the Source address and
/index.html as your target address
You can navigate to 'rewrites and redirects' in your app from AWS Amplify console and click on edit and select open text editor, and add this piece of code in your array(if present) else put the array braces around it.
{
"source": "</^[^.]+$|\\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>",
"target": "/index.html",
"status": "200",
"condition": null
}
Reference: https://docs.aws.amazon.com/amplify/latest/userguide/redirects.html#redirects-for-single-page-web-apps-spa
Reference:
https://docs.aws.amazon.com/amplify/latest/userguide/manual-deploys.html
I have faced the same problem.
I was using Manual Zip File (Compressed) download (wrong).
Here is how to deploy manually correctely:
Run this command
npm run build
Now a build folder will be created.
2. Compress the content of this folder
Not the content of the whole project.
You chnage directory to the build folder and Compress the content in side.
3. Upload that compressed file Inside the build directory
Now this should work just fine.
:)
The correct rule should be like this:
Source address: </^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf)$)([^.]+$)/>
Target address: /index.html
Status: 200
I was getting the an Access Denied error message too. The error went away when I followed the documentation described in the answer above, but then I got the white screen problem described above too.
Reviewing the steps I noticed the auto-complete for the "Destination Address" listed in the "Rewrites and redirects" settings was /. When I tried using / as the "Destination Address" instead of /index.html I no longer got the white screen and got the expected page content.
Sharing what I found in case this helps others who are seeing a white screen after fixing the error with the rewrite rule described in the answers above. (Note as of Nov 2022 the "Rewrites and redirects" setting page uses the wording "Target Address" instead of "Destination Address".)
I have faced the same problem. I was zipping build folder, but not the contents within the zip folder.
Here is how I fixed it:
Run build command
npm run build
Now a build folder will be created inside your project directory.
Open build folder.
Compress the contents of build folder, and not build folder.
Now upload this new zip created from sub files and folders from build folder.
App will run fine on AWS Amplify.
I got the same error,
I zipped the build folder first then uploaded it and got that error,
but when I just uploaded the folder without zipping it, it worked fine !! weird!!
in my application I used the port 8080

hugo serve content inside .well-known folder

Third party application which I'm trying to integrate, asking to put a file inside a .well-known folder. how can I make that file accessible from URL? (example.com/.well-known/token.txt). site is deployed as a gitlab page. every attempt I tried gives 404 error.
If you put your ".well-known" folder inside the "static" folder it should get deployed to the root of your website as you expect.

404 - File or directory (a web.config file) not found - BUT FILE IS THERE

I enter my url and it shows the directory structure. There are some folders, which I can navigate to just fine, plus a Web.config file. I click the link and get the 404 error. The same thing happens for my Global.asax file. Why can't my file be found?
You can't open them for security reasons. You're not supposed to be able to open them in a browser.
It seems you use ASP.NET framework. IIS forbid the “http access” to these files.

404 error with ClientBin

I have a few .xap files under my clientbin folder. However I am not able to get the silverlight controls working as it seems to get a 404 error - fiddler says so :)
Much appreciate your help
You will need to add a mapping for .xap to the mime type "application/x-silverlight-app" in your IIS mime map. See:-
http://www.adefwebserver.com/DotNetNukeHELP/Misc/Silverlight/SettingMimeType.html
IIS6 and beyond will serve up a 404 if asked to deliver a file the extension of which it can't find a mime map for. The wild card .* to application/octet-stream is not present on default installs of IIS6 and above.

Resources