Htaccess giving 404 error on Aws Linux 2 AMI - php

I have set up an elastic beanstalk and deployed my application to it, the application has a .htaccess file in it. .htaccess works perfectly on my localhost but when checking it on the live server it gives back a 404 error.
For Example
I have a login file named login_1.php, on my .htaccess I've set the file to be called login.
When clicking the login link on my localhost it sends me to the login_1.php file with the URL name of login, but when clicking on the login link on the live server it takes me to a 404 error.
I've followed all instructions on the internet regarding this issue but nothing seems to solve the problem. I've changed AllowOverride None to AllowOverride All on my httpd.conf file. I do not have apache on my ec2 Linux 2 AMI instance so I can't restart apache.
Any help would be much appreciated to fix this.
Thanks,
Arnav

Figured out the answer, went into my elastic beanstalk application and changed the application type to APACHE instead of NGINX. This start httpd sever and allowed me to activate the .htaccess file in my application.

Related

"404 Not found" error for my web page in LAN with lampp server on ubuntu

I have setup a small website to access in our college LAN via LAMPP server installed on UBUNTU 14.04 LTS. Its a simple application containing few html and php pages, with database as mysql at back-end.
When we try to access this website in LAN, sometimes we get access to website correctly, where as sometimes we get "404 NOT FOUND" error.
Its completely unpredictable when we will get access and when we wont.
Is it a network issue? or what? We are clueless.
Can somebody help....
Had the exact same problem a week ago is there any files in the C:\wamp64\www directory, not sure what it is in Linux... Find the below text area in the httpd.conf file, found in C:\wamp64\bin\apache\apache2.4.18\conf for Windows, and add your index page where i put my publish.htm page
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex publish.htm index.php
</IfModule>

"/" route not displaying homepage, giving 403 forbidden Laravel 5

I've deployed a test Laravel 5 application onto a development server.
The application is successfully installed but when I go to the domain that points to my application. It doesn't load the Laravel 5 homepage. Instead it gives me a 403 Forbidden Error.
I'm on an nginx server.
Possible problem is your server root is not pointing to public folder of your project, where index.php is located. Double-check your vhost configuration to be sure everything is fine.
Nginx access and error logs should help you with this. Also, check the same vhost on your local environment with development tools turned off.

"Not Found" error for all other routes except for / using laravel 5.1 on a EC2 instance AWS

Trying to set up a laravel 5.1 project on EC2 (aws). I've so far installed a LAMP stack (php 5.6) and composer. It all seems to be working fine. Was even able to run migrations for the laravel app, But whenever I try to go to any route except '/' I get a
Not Found
The requested URL /public/pricing was not found on this server.
Apache/2.4.7 (Ubuntu) Server at compute.amazonaws.com Port 80
error.
Not sure whats going on. It works perfectly fine on my localhost using mamp.
Three things to consider;
1) you should set the document root to public not the Laravel directory. In simpler words, users should be be able to access the Laravel directory.
2) check out your Apache find files or .htaccess to allow for override
AllowOverride All
3) Make sure mode_rewrite is enabled
sudo a2enmod rewrite
So it sounds/looks like you are missing the htaccess file:
http://laravel.com/docs/5.1#configuration
If you navigate to /public/index.php?pricing, the webpage will most likely show up even now.
You will need to configure the .htaccess file to pass requests to index.php to handle the routing.
I enabled mod rewrite
Set up htaccess
AllowOverride All
It didn't change anything. I then killed the connection to the server and rebooted and everything was working. Not exactly sure why this worked but fortunately it did.

Zend Framework Routing issues

I just got the Rob Allen's Album Rest tutorial working on my windows machine with sql server.
I can see all the albums show up on my screen. But when i click on the edit,delete,add links i get a "Not Found" error and it says
The requested URL /zf2-tutorial/public/album/edit/1 was not found on this server.
Am i doing something wrong here. My first guess is that i have not set vhosts, so it can be the problem. But this works just fine on my mac without any issues.
Also, as a little background. There is an IIS server running on port 80 and Zend server running on port 81.
Would this be an issue again ?
Fixed it, all i had to do was change AllowOverride None to AllowOverride All for .htaccess in my httpd.conf
http://framework.zend.com/manual/2.0/en/user-guide/overview.html

php web application and strange 404 error (something wrong with Apache ?)

I have downloaded a php web application from the web (OntoWiki).
After the installation I've tried it and it works fine on my Ubuntu 10.10, but when I try to install it on CentOS Linux, the only page that works is the home page (index.php).
If i try to change the page, the browser sends me a 404 error page (page not found).
Instead if i try to change the URL with the "index.php" as prefix it works fine.
Example:
localhost/app/index.php/directory -> works
localhost/app/directory -> doesn't work (404 error)
Why does this happen? On the PC where the program works i have the URL like: host/application but everything works fine.
Is there an Apache Configuration problem?
Thanks in advance
Check you have mod_rewrite enabled on your CentOS server.
Active the Apache rewrite module:
a2enmod rewrite
Restart Apache.
In an application like OntoWiki, all requests are directed through index.php. An .htaccess file accompanies the project including RewriteRule's to map a path like /directory to /index.php/directory.
Apache's mod_rewrite module must be installed and enabled for the host in order for the RewriteRules to be applied. It sounds like you have it disabled on your CentOS box and enabled locally.

Categories