Problem with subfolder and git repository I have prepared basic application in laravel and I my repository is located on Github.
My directories tree is typical:
└── laravel-myapp
│ ├── .git
│ ├── app
│ ├── bootstrap
│ ├── config
│ ├── database
│ ├── public
│ ├── resources
│ ├── routes
└── etc...
But in production server I had to use a subdirectory for my app .
My tree at production server (hosting) now looks like:
├── laravel-myapp
│ ├── .git
│ ├── app
│ ├── bootstrap
│ ├── config
│ ├── database
│ ├── resources
│ ├── routes
│ └── etc....
└── public_html
│ ├── othersite1
│ ├── othersite2
│ ├── othersite3
└── myapp # it's my folder /public
I would like to use Git to manage myapp but there is a problem. If I move /public folder outside project folder monitored by git, I cannot manage the repository.
Have you got any idea how to solve the problem?
Symlink to the public folder don't actually move it.
Create the git repo as normal then in the console
ln -s /path/to/public /path/to/symlink
So in your case
ln -s /public /public_html/myapp
*Note - you may have to append those paths depending on your host. Usually it's something like /home/whatever your account user is/
Thx. But now I have problem with routes. I suppose that I need to change something in .htaccess. How to fix it?
Done.
It public_html I need to set .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase ../laravel
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*?)$ myapp/ [L]
</IfModule>
Please sign in or create an account to participate in this conversation.