Issues with routes after putting my Laravel 5 project online - laravel-5

I have a problem when I put my laravel project online.
I extracted the contents of the public folder to the root and modified the contents of the index.php file accordingly.
but none of my routes are working anymore.
please can anyone help me?
thank you in advance ...

You can't move the public folder of a laravel installation.
Your web server must point to your public folder , usually :
/var/www/website.com/public

Related

What is the better way to deploy laravel application in live server?

I am confused about the deployment of the laravel project in the live server.
I searched for this and found many solutions.
There are many processes to deploy laravel projects in a live server.
Someone suggesting to remove all files and folder from public folder
someone saying to change .htaccess etc.
What is the perfect way to deploy laravel projects in the live server?
If, I have to remove public folder then, why laravel included it?
If I have to copy .htaccess to root directory and need to change it.
Then why it is not used laravel as default. Would someone explain it to me, please?

Laravel: Uploaded Files URL problems with Custom Public Path

In my Laravel 5.6 project, I have moved the public folder path from /public to /web to match the hosting environment. The entire project works fine without any issues.
However, the problem appears when I upload files and try to link them. I have searched all over and cannot find any solutions to this. I have used php artisan storage:link to link the storage. I should be able to access files put in the folder by http://localhost:8000/storage/test.png but the link comes up with the view provided for the route /, not the actual file itself.
It's as if all links to the files are being treated as routes and are showing the default route page instead of the file. I would really appreciate any assistance.
Screenshot:
https://i.imgur.com/IPa6JYh.png
I found the solution to the problem.
In the file core/server.php, I had this:
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
The public part was causing the issue. I set it to /../web to match my project's structure and the file linking started immediately afterwards.
Hope this helps someone.
Edit: the core directory is where I have moved all the Laravel files. The screenshot in the question has more details.

Laravel on a directory, links e.g. login link does not work

I have uploaded my Laravel app unto a directory under the public folder on my domain,
html_docs/public/store
where 'store' is the folder of my Laravel App. My main domain pointed at 'html_docs/public', please check my laravel app here "https://www.dinhi.org/store/". As you can see, when you click the "sell with us" or "login" on the top header, it returns
Not Found
The requested URL /store/dashboard/login was not found on this server.
I have set up to in my '.env' and in my 'config/app.php' the right url like "https://www.dinhi.org/store/" but still not working, any ideas, help please?
PS: I'm on Laravel 5.3 and I'm using Hesto Multi Auth. In my local, this issue does not exist like everything is good and working.
Laravel is not meant to be installed completely into the document root of your server. Actually, every folder of your laravel application except the public folder should be inaccessible from the web.
Your exposing yourself to a security risk here, since everybody could access every file of your app, including potential .env files with database credentials and the likes.
Cheers
Christoph

Laravel - how to protect /public/files/uploads/ from web acces by customers

I've got a question.
the admin and employee can upload stuff into /public/files/uploads/
and the customers are only allowed to see a part of the files in uploads.
but when I login as customer and visit: /public/files/uploads/
I can open and view every file.
I would like to know how to protect this from customers, like when they try to open /public/files/uploads/ they redirect back to the home view.
This would need some sort of .htaccess but I can't seem to figure out how to get it working.
Any help would be appreciated.
Thanks in advance.
Try to put an empty index.html file in this folder.
Also, are your normal URLs contain public? If so, you have wrong web server configuration and you should point your web server (Apache, Nginx) to a public directory instead of Laravel project's root folder.

Codeigniter working directory inside another working directory

Hi I am working on codeigniter for a while now and have met with an issue.
I use "localhost/controller/function" which is how codeigniter works.
Where controller classes are in controller folder in application.
I have a new codeigniter setup in root folder names "big" with its own controller, view, models etc. How can I run files in "big" like I do for my the original application.
I tried "localhost/big/controller/function", which obviously didn't work.
Please help, I am completely new with codeigniter.
just go to index.php of your application (big)
change/add line:
$application_folder = "applications/big";

Resources