A
A
Al Capone2020-09-28 03:15:43
htaccess
Al Capone, 2020-09-28 03:15:43

How to configure htacces in laravel to remove public from the address?

The site is already hosted in the public folder, because he should be there. And if you go to the site, then public is added to the address ( cosa-nostra.h1n.ru/public ). What should be written in .htaccess to be without public? Now I have it written there:


RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]


just removing public doesn't help. Hosting tech support replies: You can make the necessary settings in the .htaccess file, which is located at /www/cosa-nostra.h1n.ru/public/, but since this is a free hosting plan, they do not say what settings.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-09-28
@anonim89

if your site opens only by the /public link,
then all you need to do is put it up a level.
If not, then the document root can only be changed in the web server settings.
all other options are crutches.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question