I have two laravel 10 projects in the same domain cms and website i access the images and files from cms side that url show domain.com/cms/public/storage/pages/press/root_1683963515doc.pdf
here i remove the public from url and the cms domain like domain.com/cms/public/login
without move the file from the public folder how we change the url with out public and whic project htacces file is use to change the url here i write in cms htacces file like
RewriteEngine On
RewriteBase /cms/
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ public/$1 [L]
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
but it not working i put domain.com/cms/login
show 404 page, any way to solve this issue?
2
Answers
Just add htaccess on public folder only not any other folder
I assuming you put project like
For main issue domain.com/cms/login can’t access that
From this above tree you like to use index.php inside cms folder use your one and only htaccess. So only edit you public folder htaccess may be you remove NC it my preference. or may be use Handle Authorization Header.
For Stroage use public folder and create symbolic link on public folder and every link is available there if you are store something sensitive
don’t save on public folder save on like other folder below and access with using controller.
Use
public
folder as Domain RootMore information about "How to config domain to Laravel app?" – StackOverflow Answer
Set
storage
topublic
More information about
storage
folder on Laravel Framework – StackOverflow AnswerMore information about
symbolic links