Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Aron-Spiess's avatar

My links only work when I have index.php included in the address.

My links only work when I have index.php included in the address. my server is running apache

http://server.com/index.php/dashboards/1  -- working
http://server.com/dashboards/1  -- not working
0 likes
7 replies
Cronix's avatar

There should be an .htaccess file in the /public dir of a stock laravel install. Is it there?

The other thing to check is that the document_root of your "server.com" setup should point to /path/to/laravel/public. The "public" folder needs the be the root of the site.

Aron-Spiess's avatar

this is what's in there

<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>
Cronix's avatar

Ok, and what about the document_root in your server setup (not the .htaccess in the /public dir)? Is it pointing to the public dir if your laravel install?

Also, do you have mod_rewrite enabled on apache?

Cronix's avatar

Is that the actual path? /laravel is in the root of your harddrive? Did you check whether mod_rewrite is enabled? What Operating System are you using?

Aron-Spiess's avatar

updated last post, it's "server/sub_folder/laravel/public"

I could not find mod_rewrite in the httpd.conf file

Cronix's avatar

That's required to have it enabled. I haven't used apache in a long time, but some googling should show you how to enable it for your os and version of apache. If you're using some sort of xamp/mamp/wamp package to install apache, it should be in the control panel somewhere.

Please or to participate in this conversation.