Need solution to use directory with structure public_html

Laraship QuestionsCategory: TechnicalNeed solution to use directory with structure public_html
Steve asked 6 years ago

My shared host serves pages from directory called /public_html. I need to be able to change all references in larascript from /public to /public_html. What is the solution for this?

Note 1 : Do not suggest moving all core files to /public_html. This is not the intent of the laravel developers to expose sensitive core files.

Note 2: Do not suggest running on VPS. We want to run on the shared server with directory structure having /public_html which is a very common web hosting structure.

I await a secure, following best practices properly coded solution for this common problem.

1 Answers
Best Answer
laraship Staff answered 6 years ago

Thanks Frank !

This question is already answered here https://www.laraship.com/question/transfering-to-public_html/

Just create .htaccess file at root and add these lines to it

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteRule ^(.*)$ public/$1 [L]

</IfModule>