403 while accessing webpage using apache - apache

I set up apache and changed my home directory to my
desktop/project.
I created a webpage and when I try to open it with http:// localhost/app/index.html, and the website works properly without any problem. But when I give the link as http:// 127.0.0.1/app/index.html I get a error 403 Forbidden.
Thanks in advance. Any help will be appreciated.

Related

Is it possible to obfuscate or eliminate Http 403 status code

A web developer reached out to me to inquire if I could prevent the 403 Forbidden status from showing on a Drupal site. Of course I thought they just wanted a redirect to a 404 page or to the home page but that wasn't it. They wanted to know if I code make the 403 status code something else or prevent it from being sent to the browser.
Example: When someone browses to mysite.com/contact, they are sent to mysite.com/homepage by default because of redirection as I changed the how ErrorDocument handles 403 and 404 errors in Apache. However if you open devtools in any browser you can see that a 403 error is thrown.
The developer would like for that indication of the error code to be removed or replaced by something else. I am pretty sure it isn't possible but I have been wrong in the past so asking. I have done some Googling and can't find anything to put me on the path to finding where that is generated server-side to see if I can manipulate it. Any help would be appreciated as to find out if this is possible or not.
I agree with you, it is not possible to "override" 403 and 404 at server-side level.
What it is possible is to override 403 and 404 error pages through twig template, but it is only a frontend option

File access over https in Apache

I am using Apache 2.4.4. I used this post to get the local http website running over both http and https.
I am able to access the content via http. But if I try to access the contents over https, I am getting the error 403, Forbidden You don't have permission to access / on this server..
I tried changing file permissions using this and configuring the httpd.conf using this, still no luck.
Any suggestions/feedback is appreciated.
Solved by providing access to relevant directories rather that directly providing access to the wwwroot folder.

403 forbidden occurs for some URL

I want to know how to remove 403 issue for particular URL .
For example ,whatever comes after http://www.example.com/webapp/* , I need to remove 403 issue. How to set this?
you must configure your web server to allow pages from that file directory to be served to the public.
http://httpd.apache.org/docs/2.2/urlmapping.html#user

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.

redirection page help -apache

I have a folder where in there is a .htaccess file with some settings .. so when i try to load the page .its asks for authentication . so when i dont give the user name and passwd . it redirects to a page. i need to know where this redirection settings are there . how to get to the core.
This question is not terribly clear.
It sounds like you have authentication set up in your .htaccess file. If authentication fails, Apache returns a 401 Unauthorized (or 403 Forbidden) response. You might try redefining the error pages for those two errors using the ErrorDocument directive.