I have a Laravel 5.6 application hosted on Ycorn, there, because it is shared, I do not have SSH access, which makes it very difficult to implement the framework .
With this, the helpers {{asset()}}
and {{url()}}
can not find my CSS, JS, etc. files. This is causing me a lot of headaches as the application does not work 100%.
But, for example, url()
works for routes as well as route()
, but to access files I have to do something like
href="url('public/images/'.$imagem)"
I have read that it can be .htacess
, but I could not.
In the hosting the site is in the public_html
folder, so I moved my files from the /public/
folder of Laravel to /public_html
and set it to work.
Here is my .htaccess
:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I have tried for RewriteBase
co_de /public
but nothing worked