skip to Main Content

i need to upload project on sub folder in subdomain because there will be website,
while i am searching i found that i can use , is there another way ? because i am new to laravel and no experience in [tag:.htaccess ] — subdmoain.com
— public_html
— subfolder
—laravel project

i tried using changing App_Url

2

Answers


  1. .htaccess is of course the best way. But if you don’t know how to do that, I think you can create a subdomain from your hosting provider (like hostinger, etc), and after that, you can upload it to that folder (the one with the subdomain). Ask the hosting provider contact person, they will gladly help you to set up the subdomain

    Login or Signup to reply.
  2. Just upload your Laravel files to /public_html/subdomain/
    Then create a new file called .htaccess (yes, in the same subdomain folder) and then insert this code so it would start loading index.php from /public_html/subdomain/public/ folder which exists in Laravel App:

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

    Save it. When you visit your subdomain URL now, the app should work.
    If it throws any errors, then most likely your index.php paths aren’t correct or you do not have vendor/ folder.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search