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.

Problem removing index.php on version 2.2.1

July 12, 2011 10:51am

Subscribe [3]
  • #1 / Jul 12, 2011 10:51am

    groberts2001

    4 posts

    I followed http://ellislab.com/expressionengine/user-guide/general/remove_index.php.html,  have Apache 2.x and Mod Rewrite and have added the .htaccess lines,  set name of my site’s index page to be blank.

    We get an apache error message in the log;

    File does not exist: /var/www/html/abcd/consultancy, referer: http://www.abcd.co.uk/consultancy/

    where consultancy is a channel and abcd is the root directory for the ee files.

    Any help or redirection to another thread welcome (I’ve looked) !

  • #2 / Jul 13, 2011 12:13am

    John Henry Donovan

    12339 posts

    Hi groberts2001 and welcome to the forums 😊

    where consultancy is a channel and abcd is the root directory for the ee files.

    I realise that consultancy can be a Channel also but in the case of a UR it must be a template group or template.

    Can you confirm that consultancy is a template_group?

    Do you have a physical directory called consultancy in your root?

    Does your htaccess work as intended or is your only issue here the logged error message?

  • #3 / Jul 13, 2011 5:18am

    groberts2001

    4 posts

    Hello John,

    Consultancy is a template group,  but the path to the ‘consultancy’ directory is;

    system/expressionengine/templates/default_site/consultancy.group,

    Should it be somewhere else ?

    My issue is that .htaccess does not seem to be working.

    Thanks for considering my problem.

    Jon Roberts

  • #4 / Jul 14, 2011 1:37am

    John Henry Donovan

    12339 posts

    Jon,

    Should it be somewhere else ?

    No that is fine and has no bearing on the URL

    My issue is that .htaccess does not seem to be working.

    What happens when you visit the http://www.abcd.co.uk/consultancy/ page?
    Do you get a browser error or a blank page?

    Nevermind the log error for now

    What hosting are you using?

    Have you got a link to your website?

  • #5 / Jul 14, 2011 5:29am

    groberts2001

    4 posts

    John,

    Thanks again for considering this issue;

    The site is http://www.find-a-cottage.co.uk with the basic authentication of alison / summer.

    Its hosted on a dedicated Centos server, using EE 2.2.1.

    http://www.find-a-cottage.co.uk/consultancy

    gets the response

    Not Found

    The requested URL /consultancy was not found on this server.

    It should look like http://www.find-a-cottage.co.uk/index.php/consultancy


    .htaccess is

    <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>
  • #6 / Jul 14, 2011 11:39pm

    Lisa Wess

    20502 posts

    Hi, groberts2001 -

    I played around with your URL and found it worked if I did this:

    http://www.find-a-cottage.co.uk/?/consultancy

    So, can you try adding a question mark after index.php in your .htaccess, and see if that fixes this issue up?

    Thanks!

  • #7 / Jul 15, 2011 6:33am

    groberts2001

    4 posts

    Lisa and John,

    I’ve fixed it now,  by moving the .htaccess lines into the Apache 2 config file,  httpd-vhosts.conf.  it worked without the ‘?’.

     

    I was locked out of the system console for a while until I addded a line

    RewriteCond %{REQUEST_URI} !^/xyz_system

    which I guess means,  ‘don’t rewrite urls ending in xyz_system’

    Many thanks for your support,  I’m impressed and pleased.

    Jon

    <IfModule mod_rewrite.c>
                    RewriteEngine On
                    RewriteLogLevel 5
                    # Removes index.php
                    RewriteCond $1 !\.(gif|jpe?g|png|css|js)$ [NC]
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteCond %{REQUEST_URI} !^/xyz_system
                    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>
  • #8 / Jul 15, 2011 11:58am

    Sue Crocker

    26054 posts

    Glad things are working again.. If anything else comes up, please do let us know in a new thread..

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

ExpressionEngine News!

#eecms, #events, #releases