I'm having a weird issue with expressionengine. I have a website home page which i have created a template group for called "index". Inside index template group theres the index page template which works as expected, www.domainname.com/ goes to the index.php page. What I have an issue with is if I add other template groups, those urls will look like this:

www.domainname.com/index.php/template_group_name/template_file

I'm not sure what am I doin wrong, as in their docs the url should look like this: www.domainname.com/template_group_name/template_file

How do I remove that index.php from the domains?

2

There are 2 best solutions below

0
bambadamm On BEST ANSWER

found it, it was hidden somewhere in their manual, anyone else having the same issue, paste the following in the .htaccess file:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

source: https://docs.expressionengine.com/latest/installation/best-practices.html#removing-indexphp-from-your-urls

2
Jelle Dijkstra On

You will need to fix this with your .htaccess file in the root of your public_html.

# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]