My hosting provider doesn't allow me to upload files on root. It only give access to public folder. I tried to move index.php & .htaccess files from Project's public directory to Server's Public Directory. It temporarily solve the problem. But I have to change every single file structure. Otherwise it doesn't find link. So please suggest me to upload my Laravel Project on such Host.
0
votes
1 Answers
0
votes
Try this in your .htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain-name.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]
Of course, replace domain-name.com with your actual domain.
What this does is, it internally forwards all requests to your public folder. For example www.domain-name.com/lorem-ipsum
will be redirected to www.domain-name.com/public/lorem-ipsum
.
However, I have not tested this but it should work well in theory.