ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Having trouble with removing index.php from the URL

August 02, 2011 10:38pm

Subscribe [5]
  • #1 / Aug 02, 2011 10:38pm

    svedish

    93 posts

    Hi guys,

    I’m following this explanation about how to remove the index.php from the URL:

    http://ellislab.com/expressionengine/user-guide/general/remove_index.php.html

    My server is FeeeBSD running Apache2 so all should be fine

    Got this in my .htaccess file

    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    # If 404s, “No Input File” or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    But if I try my url with no index.php I see the main index.php of my website (I have installed ee inside a folder in my root as follows:

    root/it_ee/this is where EE is

    What is the problem? Why isn’t tis working?

    Thanks.

  • #2 / Aug 02, 2011 11:38pm

    LMO

    203 posts

    Hello svedish,

    Just to be clear when you view your site at
    http://domain.com/index.php/template.group/template the site works but
    http://domain.com/template.group/template does not work?

    Or are you having trouble removing the index.php in your links?

    I would check if mod_rewrite is installed and enabled by creating a phpinfo file to check for it.

  • #3 / Aug 02, 2011 11:56pm

    fusiondesigner

    20 posts

    This should be included by default, I do SEO professionally and find a few things odd with this cms, one is that, and another is the pagination out the box.

  • #4 / Aug 03, 2011 8:52am

    svedish

    93 posts

    Hello,

    I installed inside a folder, so if I type in

    domain.com/ee_folder/index.php/template.group/template

    all is fine.

    If I type in

    domain.com/ee_folder/template.group/template

    I see

    domain.com/index.php which is a static page I created completely outside EE.

    So you’re right, except for the fact that there is a folder in between.

    And of course all is on. I have several Open Source modules installed on this server.

    Thanks.

  • #5 / Aug 03, 2011 10:57am

    Dan Decker

    7338 posts

    svedish,

    Did you see this note in the docs about having to include the subfolder path as part of .htaccess? There are 2 suggestions in the notes for Removing index.php that directly adress having ExpressionEngine installed in a subfolder. Can you try making those suggested changes to your .htaccess and report the results back to us?

    Best,

  • #6 / Aug 03, 2011 11:15am

    svedish

    93 posts

    Hello,

    Sorry I didn’t see that note. It looks like adding the folder name to the Rewrite rule worked. So that’s done. There is only one thing left for SEO purposes. Since domain.com/folder/index.php/this_is_a_page still works, there are potentially two URLs for each content and this is not great for Search Engines. Is there a way not make the path with index.php NOT work anymore or redirect that to the one without index.php in it. I hope it makes sense. Thanks.

  • #7 / Aug 04, 2011 3:44pm

    Brandon Jones

    5500 posts

    Hi svedish,

    I am not aware of a way to do that; it would need to be done on the server-side for sure. Frankly, though, Google and other search engines are well aware of how content management systems work. I personally haven’t seen seen any evidence of index.php (or lack thereof) causing a drop in rankings due to some sort of “duplicate content” penalty. My suggestion is to relax 😊 but if you’d like, I can move this over to Community Help to see if anyone else has input on configuring a server this way.

  • #8 / Aug 04, 2011 4:45pm

    svedish

    93 posts

    Hi Brandon,

    I am not sure it is much about Search Engines knowing how CMS work. Maybe you refer to the point when Search Engines finally understood how to index pages with long queries in the URLs.
    Two pages with the same content may not penalize you, but for sure dilute the weight of a page for a certain keyword and this kind of stuff is not a detail for people that base their traffic purely on Engines.
    In fact one of the first things you do when you set up a website properly for SEO is to redirect the non www URL of your website to the www. one because for a robot those are still two different pages. Maybe yu don;t get penalized ok, but it’s better to keep the weight of internal and external links onto one page.

    That said, I could probably get away by never telling Google about the URL with index.php in it. If I build all my navigation linking to the pages without the index.php there is no reason why Google should try to access my pages by adding index.php to them. This would solve the problem, but I still think that if you decide to remove the index.php from the settings, all URL that contain index.php should return 404 or redirect with a 301.

    I think that would be a best practice purely from an SEO standpoint.

    About moving this to Community help, I’d say don’t worry. I’ll have a think about it and if I’ll need to I’ll post there directly.

  • #9 / Aug 04, 2011 6:17pm

    Brandon Jones

    5500 posts

    Agreed, No robot should be trying to insert index.php into your URLs, so if you keep those clean you should be fine. I’ll go ahead and close this but don’t hesitate to post again if anything else comes up!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases