0

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 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

-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

3 Comments

i can't make a subdomain, is there any source i can make it work because i have no idea about .htaccess can you help with link or anything ?
stackoverflow.com/questions/38685989/… maybe this one can help you, I never try it though
Thank you very much for helping, but i didn't try it because same as you i have no idea about .htaccess, i followed the other solution down

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.