Can I use multiple index.html with cloudfront? - amazon-cloudfront

I configured cloudfront default root object index.html. Now when I am hitting the domain it's working fine
example.com/
But when I am trying to access index.html present in the subdirectory i.e test/index.html
example.com/test/index.html
I am getting error
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>TddZTBdPYdd5TKCdT</RequestId>
<HostId>UDr3K4KnfdKmnWBedzvdfgtlm4k5cRVbg4HbaMm4gWZ0qzzJzdd076UrfySFDfQgvlKnEEjfV1=</HostId>
</Error>

Related

robots.txt file works in localhost but fails on server in php

I have been developing a web application in Codeigniter - PHP framework, and am creating a dynamic robots.txt for web crawlers, I use a target file robots.txt.php to be accessed dynamically by web crawlers, and the whole operation is successful on localhost.
This is my code in the .htaccess that I use to redirect the static robots.txt file to access the dynamic contents of robots.txt file :
RewriteRule ^robots\.txt$ robots.txt.php
I Deleted robots.txt file from my localhost, and the robots.txt file works perfectly when I call https://localhost.domain/robots.txt it works but commit my work, and deletion of the file to the server , and i call https://serverdomain/robots.txt
it returns a 404 error, how can I correct it. I would like to know why it works on the localhost and it does not work on the remote server.

Missing htaccess file on server?

i've just created a website. It's hosted by GoDaddy and I use cPanel to manage it.
all of my files relating to my website are stored in a public_html folder.
The problem I am having is that I cannot seem to access different pages I have uploaded, I'll show what I mean.
www.website.com --> works fine (defaults to home.html)
www.website.com/About/about.html --> works fine
www.website.com.com/About --> I get the error below:
"You don't have permission to access /About/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request."
I would like website.com/About to display about.html.
I think it may be something to do with the .htaccess file? I may of clumsily deleted it at some point.
I have tried to set permissions to 777 on all my public_html files, but I get the same error.
I have tried to locate my htaccess file, but I think its hidden by default. I've tried to find it using a terminal and connecting to my site - also with no success.
Any help to solve this issue would be great cheers!
If /About/ is a directory and these are static HTML files, rename about.html to index.html.
Servers will look for index.html in a directory if nothing else was specified in the URL.

403 permission error in YII

I have transferred my YII website from old domain to the new domain, I am changing in my host file to check the changes reflected.
My problem is that YII throwing 403 permission error if I am not using slash(/) after the URL but if I put slash (/) after the site name all working perfectly.
Working setting
ipaddress http://example.com/
Not working setting
ipaddress http://example.com
How i will able to remove that permission error without using slash(/) in hostfile setting. I have also tried it by using .htaccess file, it throw 500 internal server error, when using htaccess file

404 Redirect Error with .htaccess

I'm running a website on a local server (using WAMP Server) and I'm trying to test to see if my 404 page would work, but when I try to navigate to a nonexistent page, I get an error that says:
The requested URL /dsf/sdkmf was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.
My 404 page is in the root folder with all my other pages and my .htaccess Error Document handle is listed as:
ErrorDocument 404 /404.html
I don't know why it's throwing me this error much less how to fix it, does it have something to do with my WAMPServer configuration?
Never mind - I figured out how to solve it on my own - apparently you have to use the direct path to the file - even if it's in the root directory of the site itself!

500 Internal Server Error instead of 404

This is my .htaccess
ErrorDocument 404 /404.html
But when i type a wrong url for example, http://127.0.0.1:8080/myweb/wrong-url.php, that doesn't go to 404.html and says 500 INTERNAL SERVER ERROR
any body can explain why?
The error that is showing in my error log is
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error.
Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
It is likely that your 404.html page is, itself, generating another 404 because the location is not /404.html, but /myweb/404.html. Basically it tries to find the 404.html file, but can't, which generates another 404, then tries to find the 404.html file, but can't, which generates another 404 etc etc. Change your .htaccess to point the 404 to /myweb/404.html, or move the file to the root of your server.

Resources