Reputation: 1
My objective
DocumentRoot "/var/www/html"
/var/www/html/blog
/var/www/html/blog/routes/web.php
set routes
Route::get('demo','DemoController@index');
<HTTP_HOST>/blog/public/demo
to call DemoController
Question
- If I want to use URL to <HTTP_HOST>/blog/demo
replace <HTTP_HOST>/blog/public/demo
, How to write .htaccess at /var/www/html/blog/
?
Upvotes: 0
Views: 1711
Reputation: 345
Create a .htaccess file your Laravel root directory if it does not exists already.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Try with this. Hope its help you.
Upvotes: 1