Support the ongoing development of Laravel.io →
Configuration

I have this code in my .htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

But it didn't work as you can see in the screenshot below:

Link to screenshot: http://i.imgur.com/n8AYlcX.png

However if I change my .htaccess file to:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

Then I can see this on my browser:

Link to screenshot: http://i.imgur.com/yjhTEx0.png

This is how my folder structure looks like:

Link to screenshot: http://i.imgur.com/t91w2OH.png

What have I tried?

I have already enabled my mod_rewrite in XAMPP to try to fix my solution. I had followed these steps in the link below:

Link: http://www.leonardaustin.com/blog/technical/enable-mod_rewrite-in-xampp/

Last updated 3 years ago.
0

Your first screenshot suggests that something is working when you have the rewrite rule. That fancy error page that says "NotFoundHttpException" was created by Laravel - so your first code block seemed to be working.

That error you are getting is saying that Laravel isn't finding a matching route declared within your code. There are two issues here, either you have not declared your a route for for 'portfolio-saky-2', or Laravel is having trouble accessing the uri of the route you are trying to access.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

superzaky superzaky Joined 9 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.