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

ReakyMark's avatar

how to remove index.php from url

i don't know why sometime i enter url in browser bar it take me to url that has index.php in url and it make my image not show. example:

my image path: https://domain.com/upload/image.jpg

but when in url has index.php it give the path https://domain.com/index.php/upload/image.jpg

how can i fix this all my image not load when it has index.php in url ?

this is my httaccess

<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>


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Header set Content-Security-Policy: upgrade-insecure-requests
0 likes
1 reply
manojo123's avatar

Please provide your server configuration in order to help you

Please or to participate in this conversation.