Joomla 403 Forbidden when trying to access php file - php

I have a Joomla site. I've created a subfolder with a landing page.
This landing page was coded in HTML + CSS. This works perfectly but now I have added a little PHP plugin to manage MailChimp subscribers. But when I try to access to the php file, the server throws the following 403 error:
Forbidden
You don't have permission to access http://www.domain.es/folder/sub-folder/server.php
I have changed the .htaccess file to allow PHP files the following way (but it doesn't work):
<FilesMatch *.php$>
Allow from all
</FilesMatch>
Any ideas?

Try renaming server.php to myfile.php and see if you still have the same problem. It might be that your Apache server configuration has a rule to block server.php because, in many instances, files that have server.php as their name are malicious.

Related

Webiste url are not routing without index.php

I uploaded my website from my UAT/Test domain to EC2 AWS. Before everything was fine, but now only home page opens.
And if I try to navigate to any other links I can't, it gives following error
The requested URL /page/company was not found on this server.
But when I insert index.php in between it works fine.
Any ideas?
Please enable mod_rewrite module in your server and rewrite index.php in htaccess file.
Please check your file premissions
I believe the issue could be DirectoryIndex which apache (not positive that is what you are using as web server) uses to direct the user to a specific file if a directory is selected in the URL.
This can be set in your apache config if you have access, or in a .htaccess file if you only have access to the your webspace itself.
http://www.htaccess-guide.com/directoryindex-uses/
Basically with DirectoryIndex you can tell apache to automatically use index.php, or index.html, or really whatever file you want to be used when no file in a directory is given in the URL.

403 Forbidden Error - iPage

I have an issue with my website, I linked it with Wordpress but there's a sub-menu where I get a 403 forbidden error.
This is the folder in iPage
And here's the Wordpress page I want to show up
I tried removing the .htmaccess file and refreshing the permalinks but it didn't work at all.
Any help?
Noo, Wordpress dont need any folders.
Wordpress works with the .htaccess
You can delete this folder and restart your server.
You don't have to add any directories or files after WP installation is finished, all WordPress functions will work via administration panel. But let me explain what is going on.
The 403 forbidden error you are getting is normal and expected webserver behavior in your case.
The webserver checks the request (the URL given) and tries to determine if it is a file or a directory. In your case it is a directory, which (by default) makes your webserver serve index.html or index.php file inside that directory.
However, if no such file exists, the webserver's next step is to list all items in a directory, which you don't want and is disabled in your case (and in most web server's by default for security reasons), thus webserver returning 403 forbidden error.
You can try to add a file named index.html inside your directory and see what happens, the 403 forbidden error will be gone and webserver serve your file.
If you want to serve your WordPress page instead of the actual directory you have on the server, you will have to remove or rename the directory on your server, or rename the permalink for the WordPress page.

Forbidden Error 403 On Server Folder

I'm trying to host a new blog where I can add posts using a simple HTML form & PHP script. When I test out the form on my localhost everything works fine, but when I upload it and test it live I get:
Forbidden
You don't have permission to access /php/add-post.php on this server.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.
I know that my host allows this type of script because I'm using exactly the same thing on another blog, and my permissions are set to 0755. Does anyone know what the problem might be & how to solve it?
Add the below code in .htaccess file
<Files add-post.php>
Order Deny,Allow
Deny from all
Allow from all
</Files>
Or run command to provide permission to folder
chmod 774 /path/to/php/add-post.php

How to add a new .php page/view in a subdirectory of a my website which contains a .htaccess file?

I'm using this php login script as a jumpstart for my website
This is my directory listing for the views folder of my site:
>_installation
>classes
>config
>libraries
>views
.htaccess
logged_in.php //works fine
newpage.php //new page returns a Error 403
not_logged_in.php //works fine
register.php //works fine
index.php
register.php
The file .htaccess file in views folder contains:
# This file prevents that your .php view files are accessed directly from the outside
<Files ~ "\.(htaccess|php)$">
order allow,deny
deny from all
</Files>
I'm wondering why the newly added nawpage.php in the same folder views returns an Access forbidden! Error 403 everytime I access it. But, the remaining .php files in views works perfectly.
This is the complete error details:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
127.0.0.1
Apache/2.4.16 (Win32) OpenSSL/1.0.1p PHP/5.6.11
Can someone help me fix and understand this? Thank you so much.
Well, Let me answer your question.
You can read your php file for example you can write your index.php file
include "view/newpage.php";
It will work fine. But you can't access view folder any file directly from your browser. You can access these file from your php code or only from that server end.

Silverstripe not working on Plesk Server

I am trying to create a new domain which runs on SilverStripe 3.0. I am unable to figure out the issue. If I upload a custom php page then it runs fine, but my website is not working. It shows blank page but shows the favico.
If I try to open up www.mydomain.com/admin/, I get the error
Page Not Found
The requested URL /admin/pages was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is not a Silverstripe error page. Here is my php info Info
Please let me know if I am missing something or there is any way to figure out the issue.
Try www.yourdomain.com/index.php/admin
If that works then it is because your rewrites are not working. This can be because .htaccess isn't configured properly, or because .htaccess is not used at all (in which case you need to edit your server config).
Last I used Plesk it always used apache. If that is different now and you're using nginx as more than a forward proxy, then you will need to set up the redirects for your site manually.
It does sound like your .htaccess is not being respected. Does Plesk allow overrides for .htaccess in the local directory?
At an apache level we would have something like this stanza to ensure the the .htaccess of the project was respected;
AllowOverride All
If your .htaccess is being processed, make sure that your host has mod_rewrite enabled as that is required to access to pretty URLS.

Categories