0

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: https://i.sstatic.net/Cox4x.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: https://i.sstatic.net/n8eMv.png

This is how my folder structure looks like:

Link to screenshot: https://i.sstatic.net/DDZA0.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/

3
  • 1
    Just out of curiosity, which editor is this? i.imgur.com/t91w2OH.png Commented Dec 2, 2015 at 11:41
  • 1
    Sublime text 3 with Seti UI theme. Commented Dec 2, 2015 at 11:49
  • Oh, ok. I thought it was VS Code Commented Dec 2, 2015 at 12:00

2 Answers 2

1

All you need to do is point the home directory of your site config in Apache to the public folder of your Laravel installation. Currently, it seems to point to its root folder.

Sign up to request clarification or add additional context in comments.

3 Comments

Any other solution is just crap
I don't exactly know what you mean. You mean like this in my hosts file?: 127.0.0.1 localhost/portfolio-zaky-2/public/ But that didn't worked for me.
Nope, not in your host file. In your Apache config for your local dev website.
0

In your vhost you should make the domains documentroot point to the /public folder.

DocumentRoot "/home/vhostsfolder/laravelproject/public"

instead of

DocumentRoot "/home/vhostsfolder/laravelproject"

What server are you using? Local/sharedhosting/vps ?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.