3

I Have A shared host and i have made a laravel project and when i upload it to the host i made a htaccess file to redirect all requests to publc/index.php and it works very well and laravel project work good when i create a sub domain and but some files in subdomain's folder and try to access it i got a 500 Internal Server Error when i contaced the support they told me that this error because the .htaccess that i made i need help to solve this problem this is the structure of my public_html folder

-public_html
 |-laravelproject
   |- Laravel Projct Files
 |-subdomain
   |-index.php
 |-.htaccess

.htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^laravelproject/public
    RewriteRule ^(.*)$ laravelproject/public/$1 [L]
</IfModule>
7
  • Do you have ssh access? Commented Aug 22, 2018 at 0:30
  • Also, shared hosting providers usually use cpanel, which usually have "Magic installers" for laravel, wordpress, ruby on rails, etc... Commented Aug 22, 2018 at 0:30
  • @Erubiel , yes I have Commented Aug 22, 2018 at 0:31
  • Is this question related to yours? stackoverflow.com/questions/31543175/… have you checked permissions? Commented Aug 22, 2018 at 0:32
  • @Erubiel, it's work very will with main domain but its not working with subdomain Commented Aug 22, 2018 at 0:32

1 Answer 1

1

Since subdomain is other installation i think you should add

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^laravelproject/public
    RewriteRule ^(.*)$ laravelproject/public/$1 [L]
    RewriteCond %{REQUEST_URI} !^subdomain/public
    RewriteRule ^(.*)$ subdomain/public/$1 [L]
</IfModule>

But im no .htaccess expert, hope it works!...

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

Comments

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.