-2

I´m looking for solution for my laravel project problem (laravel version: 6.5.2). I found a lot of similar questions, but no solution.

So, I have created new laravel project and then i put it on my hosting.

My FTP structure is:

 - www
 - AutsokolaIS

In www folder, I copied content of Public folder and in the AutoskolaIS other folders and files (app, bootstrap, config, etc.)

Everything was good, until I tried to create a new page linked to welcome page.

Link is mydomain.com/page. After click on this link, I get 404 error page. When I directly open the URL mydomain.com/index.php/page everything works.

I know it´s problem with .htaccess file, but I´m not able to edit .htaccess file in correct form.

Can anyone please help me?

Thank you

Tanveer Badar
  • 5,438
  • 2
  • 27
  • 32

1 Answers1

0

By default the website will be load from public folder. If you want to remove public from your url,copy .htaccess file from public folder to root and replace the code with the following..

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>

RewriteEngine On


RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
Jithesh Jose
  • 1,781
  • 1
  • 6
  • 17