2

I have shared hosting, I have created lot of webiste on it,

recently I have created laravel project, on local it's working fine, I have uploaded that file into subfolder i.e http://myurl.com/laravel_project

but when I am hitting this url it's not working, its giving an error

Forbidden You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

and when I am hitting http://myurl.com/laravel_project/public it is working fine,

I want to work that pulic folder as a http://myurl.com/laravel_project

I have created .htaccess file on http://myurl.com/laravel_project and the code is

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

but it showing

Page not found

Homepage | Go Back

Community
  • 1
  • 1
  • its laravel drowback you can deploy your laravel project on sub domain and your issue solve – Bhargav Chudasama Dec 07 '19 at 05:09
  • i cannot make the sub domain because i dont have the access – daniyal butt Dec 07 '19 at 05:14
  • we just wanted to show the demolinks to the client, when he final it we will deploy this to his/her domain with sperate hosting – daniyal butt Dec 07 '19 at 05:19
  • Does this answer your question? [How to point laravel project to a public folder under public\_html in shared hosting](https://stackoverflow.com/questions/55094509/how-to-point-laravel-project-to-a-public-folder-under-public-html-in-shared-host) – Jaydeep Mor Dec 07 '19 at 05:24

1 Answers1

0

Create a .htaccess file to your sub folder that laravel exist, and paste this code inside file.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
Sajad Haibat
  • 697
  • 5
  • 12