AWS beanstalk htaccess - .htaccess

I have created an instance using AWS Elastic beanstalk; However, on deploying my code zip (containing .htaccess), I am unable to see the uploaded .htaccess file using SSH/WINSCP.
I need to define htaccess so that I can host a separate blog in a subdirectory. Right now, when I enter www.example.com/xyz. It's not reading XYZ as a directory. and showing 404 error.
My Question: If there is some solution I can make the main website treat directory as a directory instead of its normal page.
Note: I have changed "/etc/httpd/conf/httpd.conf" file line from
<Files ".ht*"> Require all denied</Files>
to
<Files ".ht*"> Require all granted</Files>
No success.

Related

.htaccess is restricting access to root level pages. How do I stop this?

I have several webpages on my root directory (e.g. index.htm, home.php and home_page.php) which all are starting points for different versions of my website.
I ahve upgraded PHP version (as advised by my hosting service) from 5.3 to 5.6. This has put a .htaccess file on my site and now my PHP pages on root won't load and I get a "500 Internal Server Error" message.
The .htaccess file was created by the web hosting provider when the PHP version was updated.
The content of the .htaccess file is AddType application/x-httpd-php56 .php .php5.
If I delete the .htaccess file then my pages work OK as before but I do not know what the implications of deleteing this file are.
How do I log my exception errors?
Any help on how I can getall of my pages to be displayed, please?

Only allow users in my htpasswd list to access a file, but also allow wordpress to access the file

I have an XML file that I want to be only accessed by users via my wordpress deployment - but not if they try and access the file directly.
Is that possible?
I tried the following but it doesn't appear to work:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https?://my-domain.com/ [NC]
RewriteRule \.(xml)$ - [NC,L,F]
Any suggestions? Thanks in advance, love this community.
There are two ways:
Put the sensitive config file outside of the web root. The httpd follows the local file system hierarchies and privileges, not its own (virtual) virtual structure.
If your host does not allow this, you can restrict any HTTP requests to the files using .htaccess. Put the config file in a separate directory with a .htaccess file that blocks everybody (or a list of IPs, etc).
<Files important.xml>
Order allow,deny
Deny from all
</Files>
Since the web server still can read and execute the file PHP can access and process it too.

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.

Could not access php file on core modules's external folder in social engine4

I have installed the plugin 'Advanced Search Plugin Like Facebook Search' of younet and I noticed the error that application/modules/Core/externals/scripts/ynadvsearch.php is not found.
Then I checked the location and the file was there. So I uploaded a test.php file and typed the url in address bar then also I could not access the test.php page. But I am able to access all the js pages on that folder.
I have deleted the htaccess file of external folder. But the issue remains the same.
How can we fix this?
It's a little weird, usually /externals/scripts folder is used only for javascript-files (and all php-files - inside of /controllers folder).
File .htaccess inside of /externals folder contains a rule
<FilesMatch "\.avi|flv|mov|wmv|wma|mp3|mp4|m4a|mkv|swf|pdf|doc|ppt|ico|jpg|jpeg|png|gif|js|css)$">`
It means that *.php files are not allowed for access inside of this folder.

deny from all in .htaccess not blocking file in the corresponding folder

I have an .htaccess file in the folder called folder and another file, called form.html in the same folder
When I try to reach the folder (by entering http://blablabla/folder/), it does block the access and I am getting an error 403 but when I enter the exact URL of the file http://blablabla/folder/form.html anf hit enter, I can access the file as easily as if I haven't put any .htaccess file.
Am I doing something wrong?
Am I missing something, should I use something like or
Sorry if the question is really basic...
.htaccess is a container for directives for your apache web server that apply to that directory and below only. What directives have you got in your .htaccess file?
The behaviour you outline above is how apache should behave with no .htaccess folder.
What is it that you are wanting to happen?

Resources