1

I have a Laravel project running on a shared hosting. after adding this .htaccess

RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.site.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

Laravel works in site.com/ and site.com/public too.

how to let it work just in the root domain?

elkebirmed
  • 2,247
  • 6
  • 24
  • 35

1 Answers1

0

Try to follow these steps. You don't need to change in thing in htaccess file.

  1. Rename server.php in your Laravel root folder to index.php
  2. Copy the .htaccess file from /public directory to your Laravel root folder.
Qasim Ali
  • 587
  • 2
  • 11
  • 28