Laravel project hosted in Cpanel gives HTTP ERROR 500 - laravel

I created laravel 5.2 project and it works perfect in localhost..
Now when I uploaded to cpanel and tried to access through internet it gives me these errors.
access url : "http://orderproject.sutchelinks.com/public/"
error :
The orderproject.sutchelinks.com page isn’t working
orderproject.sutchelinks.com is currently unable to handle this request.
HTTP ERROR 500
what could be the reason??

Create a .htaccess, add the following lines and put the file in your root folder. I see that you've got it working but you're not supposed to have the */public at the end.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</ifModule>
Try it, I got my Laravel application working with this.

Related

How can i browse laravel application on wordpress website?

I have a website which is build in wordpress and another application which is build on laravel. I want to browse the laravel application from wordpress folder structure.
How can i make it possible ?
http://www.example.com -> primary website
http://www.example.com/app -> laravel application
Thanks in advance.
Do the following:
create app folder on primary website folder
upload and config laravel project on app folder
create the .htaccess file so that it contains the following code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

Remove /Public from url in Laravel

Good Day!
Hello,
Currently I was working on laravel and im new on it. I keep looking a solutions on my problem and i couldn’t find a solution on this. My laravel work is accessible already without /public in the url I fix this thru .htaccess, but it can be access also with /public in the url. Please see links below for your reference.
https://utok.ph/
https://utok.ph/public
my htaccess file
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
.htaccess files wont work on this, what i did is i update the root directory in my server side.
instead the root will be at public_html I change it to public_html/public

Migrating a CodeIgniter site to a different domain and moving the whole thing down one level in directory

I am working on a site, which is built with CodeIgniter.
I have never used the framework before...I've learnt a little bit in the last couple days but really cannot solve my problem.
I have downloaded the site and I want to upload it to my own domain so not to make changes to the live site before testing.
the original site is example.com.
I want to upload it to mysites.com/examplesite (this will be the base - I use this domain for all my clients' test sites).
I have moved all the files and the database is in place.
I have found the database configuration file and have successfully edited it.
I am having trouble getting the site to work, I think it must be because of the site now being down a directory level.
I have edited $config['base_url'] so that it is correct...I am pretty sure it is correct because I can now reach the homepage where I couldn't before editing that variable. But, i can only reach the homepage - when I click on a link to another page, I get 500 error Internal server error.
Does anyone have a quick fix for me?
Thanks!
Keep this code on your project's root .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /examplesite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

CodeIgniter links not working in localserver

I have a copy of PHP project running using CodeIgniter framework. It's hosted in some server and when I am trying to access a particular URL
www.xxxdomain.com/member/member/index
The above URL is loading a page with CSS
it I call the same link in the below manner still the page is loading but it couldn't load CSS
www.xxxdomain.com/member/index.php/member/index
now, when I download this code and trying to run in my own localserver when I am trying to call as http://localhost/project1/member/member/index I am getting an 404 error at the same time when I call it as http://localhost/project1/member/index.php/member/index the desired page is loading but loading without CSS.
How come the page load with the same URL in my server and not running in my localhost?? I changed the base_url setting and I am pretty high sure that I replaced all instances with the localhost url instead of server url but still the issue persists.
Any idea how to fix this?
create a file .htaccess in your root CI folder in you localserver...
and paste this Rewrite code..
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
if you want to read more about htaccess..
make sure u leave your config index_page blank....$config['index_page'] = "";

Ajax response call, 404 Not Found

i tried to use wordpress and codeigniter for a intelligent join between the best CMS and the best PHP Framework. Actually i intended to use codeigniter for database managemnent and wordpress for display. But i wanted to use codeigniter inside wordpress. So, i have a file tree like that:
www
- codigniter-core folder
- .htaccess
- wordpress-core folder
- .htaccess
- index.php
How can i make the wordpress .htaccess to cover also the codeigniter ant not trowing 404 error in jquery ajax call. My current wordpress .htaccess file it's:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/codeigniter-core/
RewriteRule ^(.*)$ /index.php/$1 [L]
I also tried to ask this to Wordpress Forums and Codeigniter Forums, but no answer. I think it's hell of a rewrite condition or rule, but i don't know ...
I had this problem when creating a controller file that I would call via the jQuery ajax method. This controller file included wp-blog-header.php.
When you include the wp-blog-header.php in a file outside of WP framework WordPress does a check on the current file, and if it is not in its database it returns a 404. The work around is to add a 200 status header after the wp-blog-header.php.
header("HTTP/1.1 200 OK");
Now (jQuery) ajax to the file returns properly without a 404.
This worked great... can't tell you how long I was looking for this answer. I suspected this had to do with a header error because firebug showed the response but the header had a 404. Thanks this saved me a lot of time.
BTW I used this to fix the Quick Search plugin by Giulio Ganci
Just open the "search.php" file in the plugin folder and add
header("HTTP/1.1 200 OK");
Right after the first line of code. When your done the first few lines of code in this file should look like this
<?php
require('../../../wp-blog-header.php');
header("HTTP/1.1 200 OK");
if (isset($_GET['s']) && trim($_GET['s']) != '') {

Resources