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.

Trouble removing "index.php" from my URL

April 26, 2009 7:05pm

Subscribe [4]
  • #1 / Apr 26, 2009 7:05pm

    longterm

    12 posts

    Hi,

    I’ve tried several different versions of an .htaccess file, but none of them successfully allow me to use an URL that doesn’t have “index.php” in it.

    In addition, and perhaps this is a clue, I can still put “index.php” in the URL and get to various pages, even though I’ve removed “index.php” from my config in system preferences.

    I’m trying to get this to work on a Mac server running OS X Server 10.4.11. If you can help, I’d greatly appreciate it.

    Best regards,

    Bob Patin
    Longterm Solutions

    [Mod Edit: Moved to the How To forum]

  • #2 / Apr 27, 2009 5:28pm

    Gareth Davies

    491 posts

    Hi,

    Have you tried the LG .htaccess extension - http://leevigraham.com/cms-customisation/expressionengine/lg-htaccess-generator/

    Also, in your apache configuration you need to make sure that you don’t have an ‘AllowOverride’ set to ‘None’ so your .htaccess file is allowed to do something - there’s details here on that: http://httpd.apache.org/docs/1.3/howto/htaccess.html#troubleshoot

    From the above source - A good test for this is to put garbage in your .htaccess file and reload. If a server error is not generated, then you almost certainly have AllowOverride None in effect.

  • #3 / Apr 27, 2009 6:35pm

    longterm

    12 posts

    Hi,

    Have you tried the LG .htaccess extension - http://leevigraham.com/cms-customisation/expressionengine/lg-htaccess-generator/

    Also, in your apache configuration you need to make sure that you don’t have an ‘AllowOverride’ set to ‘None’ so your .htaccess file is allowed to do something - there’s details here on that: http://httpd.apache.org/docs/1.3/howto/htaccess.html#troubleshoot

    From the above source - A good test for this is to put garbage in your .htaccess file and reload. If a server error is not generated, then you almost certainly have AllowOverride None in effect.

    Yes, I tried the extension, but it didn’t work either. I looked for the appropriate code in httpd.conf, but couldn’t find it, which makes me wonder if perhaps I’m looking in the wrong file.

    The extension definitely wrote to the htaccess file but it didn’t allow me to remove the index.php page from the URL.

    Do you know where specifically in http.conf I’m supposed to be changing AllowOverride? What I found online wasn’t in my httpd.conf file.

    Thanks for the suggestions…

  • #4 / Apr 27, 2009 6:47pm

    Gareth Davies

    491 posts

    The first thing I would do is check that your .htaccess file is being processed so stick any old rubbish in there (just type randomly, save and upload). This should then generate an error, as it’s rubbish, if your .htaccess file is being processed (so don’t do this at a critical time!) If you are getting an error, simply upload a blank file to restore access to your site.

    If it doesn’t generate an error then you probably do have an AllowOverride setting but do this first as no point messing about with the config files unless sure…

  • #5 / Apr 27, 2009 10:00pm

    longterm

    12 posts

    The first thing I would do is check that your .htaccess file is being processed so stick any old rubbish in there (just type randomly, save and upload). This should then generate an error, as it’s rubbish, if your .htaccess file is being processed (so don’t do this at a critical time!) If you are getting an error, simply upload a blank file to restore access to your site.

    If it doesn’t generate an error then you probably do have an AllowOverride setting but do this first as no point messing about with the config files unless sure…

    Well, it didn’t generate an error; so this means that I DO have an AllowOverride setting somewhere, right?

    I looked at httpd.conf; I’m on a Mac, so (this is info I found on the web, so I’m not giving away a secret here) looked in

    private/etc/httpd/httpd.conf

    Is that the right file, or should I be looking elsewhere?

    There are several instances of AllowOverride; here’s what I see:

    1. The first one is preceded by “First we configure the “default” to be a very restrictive set of permissions…

    2. The 2nd has to do with icons

    3. has to do with CGI-executables

    ... but nothing about htaccess.

    Could it be that there’s another httpd.conf that is the one I should be editing?

    Thanks for any help… 😊

    Best,

    Bob Patin
    Longterm Solutions

  • #6 / Apr 27, 2009 10:17pm

    longterm

    12 posts

    The first thing I would do is check that your .htaccess file is being processed so stick any old rubbish in there (just type randomly, save and upload). This should then generate an error, as it’s rubbish, if your .htaccess file is being processed (so don’t do this at a critical time!) If you are getting an error, simply upload a blank file to restore access to your site.

    If it doesn’t generate an error then you probably do have an AllowOverride setting but do this first as no point messing about with the config files unless sure…

    OK, I found another instance of “httpd.conf” which DID have the section with AllowOverride pertaining to htaccess.

    So I changed it to AllowOverride All

    ... then I went into System Prefs for EE, deleted the filename “index.php” and tried it. No joy.

    This is probably something very simple, but I’m stymied…

    Any help is really appreciated!

    Best,

    Bob Patin

  • #7 / Apr 27, 2009 10:22pm

    grrramps

    2219 posts

    Did you reboot Apache in OS X?

  • #8 / Apr 27, 2009 10:28pm

    longterm

    12 posts

    Did you reboot Apache in OS X?

    Yep… didn’t help though…

    BP

  • #9 / Apr 27, 2009 10:31pm

    grrramps

    2219 posts

    It’s gotta be some kind of config issue with Apache. I ran a Tiger Server for two years and never could figure out what it needed to remove index.php, so I learned to live with the pain. Removal is purely an aesthetic issue, anyway.

  • #10 / Apr 27, 2009 10:32pm

    grrramps

    2219 posts

    It’s gotta be some kind of config issue with Apache. I ran a Tiger Server for two years and never could figure out what it needed to remove index.php, so I learned to live with the pain. Removal is purely an aesthetic issue, anyway.

    BTW - just to add to this, has anyone figured out how to remove index.php using MAMP?

  • #11 / Apr 27, 2009 10:38pm

    longterm

    12 posts

    It’s gotta be some kind of config issue with Apache. I ran a Tiger Server for two years and never could figure out what it needed to remove index.php, so I learned to live with the pain. Removal is purely an aesthetic issue, anyway.

    Another interesting thing about this: I’ve removed “index.php” from the System Prefs, but still I can get to pages by putting “index.php” in the URL. Is this normal?

    I agree with the person who said it’s just an annoyance, but it really shouldn’t be so hard to get rid of it. Hopefully this will be addressed in v2…

    Thanks for any help,

    BP

  • #12 / Apr 27, 2009 11:17pm

    grrramps

    2219 posts

    I agree with the person who said it’s just an annoyance, but it really shouldn’t be so hard to get rid of it. Hopefully this will be addressed in v2..

    The thing to remember with this is that it’s not an EE issue. It’s a server configuration issue. That’s exactly the same as with WordPress, Joomla, Drupal, etc. The index.php is there for a reason, but can be bypassed assuming Apache is configured appropriately.

  • #13 / Apr 28, 2009 1:19am

    Gareth Davies

    491 posts

    I’m assuming that you only have the one domain configured in apache and are not running any virtual hosts?

    If so, in the post above where you’ve written “1. The first one is preceded by “First we configure the “default” to be a very restrictive set of permissions…” then change this AllowOveride from None to All and restart apache. You’re not looking for it to say .htaccess anywhere if that’s what is confusing you.

    As you’re not getting an error, it’s simply not reading your .htaccess file so it’s going to be the AllowOveride setting.

  • #14 / Apr 28, 2009 10:24am

    longterm

    12 posts

    I’m assuming that you only have the one domain configured in apache and are not running any virtual hosts?

    If so, in the post above where you’ve written “1. The first one is preceded by “First we configure the “default” to be a very restrictive set of permissions…” then change this AllowOveride from None to All and restart apache. You’re not looking for it to say .htaccess anywhere if that’s what is confusing you.

    As you’re not getting an error, it’s simply not reading your .htaccess file so it’s going to be the AllowOveride setting.

    No, this is a server running approximately 50 sites, all virtual.

    So I should change that first AlowOverride then… I did change one that referenced htaccess, I’ll try this other. However, according to instructions I found on the web in several locations, the variable in httpd.conf that I needed to edit was preceded by text that discussed htaccess, as in this text:

    Use ctrl-w to find �Override�. You need the second instance of the term so search twice. You should see:

    # This controls which options the .htaccess files in directories can
    # override. Can also be “All”, or any combination of “Options”, “FileInfo”,
    # “AuthConfig”, and “Limit”
    #

    I found that in a 2nd httpd.conf file, but not in the one that is in my httpd directory…

    I’ll give your suggestion a try.

    Thanks,

    BP

  • #15 / Apr 28, 2009 1:12pm

    Gareth Davies

    491 posts

    OK - just trying to get some more info - at the bottom of your apache config file do you have a load of <VirtualHost> entries?

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

ExpressionEngine News!

#eecms, #events, #releases