Question By
Unsolved

Problem with rewrite an url in Laravel

lakamark

Oct 30th, 2016 03:03 PM

<p>Problem with public root in Laravel.</p> <p>&nbsp;</p> <p>I&nbsp;try to rewrite the url in Laravel with only .htacess file in my root of my Laravel Project :&nbsp;</p> <p>(I use the version 5.3 of Laravel Framework)</p> <pre class="language-markup"><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] &lt;/IfModule&gt;</code></pre> <p>I have an error :</p> <p><abbr style="border-width: 0px 0px 1px; border-image: initial; cursor: help; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 20px; background-color: #dddddd; border-color: initial initial #000000 initial; border-style: initial initial dotted initial;" title="Symfony\Component\HttpKernel\Exception\NotFoundHttpException">NotFoundHttpException</abbr><span style="color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 20px; background-color: #dddddd;">&nbsp;in&nbsp;</span><a style="color: #868686; cursor: default; background: none #dddddd; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 20px;" title="/var/www/local.dev/lakamark/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php line 161">RouteCollection.php line 161</a><span style="color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 20px; background-color: #dddddd;">:</span></p> <p>Thank your.</p> <p>&nbsp;</p>
mark

Nov 27th, 2016 04:26 PM

<p>To solve this I need a few informations:</p> <p>&nbsp;</p> <ol> <li>Where is your Laravel application placed</li> <li>What url are you visiting when getting this error</li> <li>What does your routes.php file look like (web.php in newer versions of Laravel)</li> </ol>