Search code examples
laravelwordpressdeploymentsubdirectory

deploy Laravel project on subfolder in subdirectory


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


Solution

  • 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.