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]
  • #16 / Apr 28, 2009 1:29pm

    longterm

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

    Thanks for the reply…

    This is a Mac running OS X Server, which is Apache, so I don’t delve into config files, do everything with OS X Server’s GUI. I have approx. 50 sites hosted virtually on this machine, perhaps more.

    Is that going to prevent my nuking “index.php” from the URL?

    Thanks,

    Bob Patin
    Longterm Solutions LLC
    .(JavaScript must be enabled to view this email address)
    615-333-6858
    http://www.longtermsolutions.com
    Twitter: bobpatin
    iChat/AIM: bobpatin
    FileMaker 9 Certified Developer
    Member of FileMaker Business Alliance & TechNet
    —————————————
    FileMaker hosting and consulting for all versions of FileMaker
    PHP • Full email services • Free DNS hosting • Colocation • Consulting

  • #17 / Apr 28, 2009 1:36pm

    Gareth Davies

    491 posts

    Okay. Well I’m not familiar with the OS X Server GUI but it’s still the same Apache config (httpd.conf) file.

    I assume you can definitely read the file as you’ve provided the locations and contents of it above. At the very bottom of the httpd.conf there should be a section about <VirtualHosts> which is how Apache handles multiple domains. You can configure in there a per domain policy for .htaccess as opposed to the default policy for the server (though this may not be an issue if you want .htaccess enabled on all).

    Have you tried to change the default <AllowOveride> to All to see if that works?

    You are going to have to make a change to an apache config file if you want this to work, though you may have to get someone who knows the system better than I who can talk you through it.

  • #18 / Apr 28, 2009 2:08pm

    longterm

    12 posts

    Okay. Well I’m not familiar with the OS X Server GUI but it’s still the same Apache config (httpd.conf) file.

    I assume you can definitely read the file as you’ve provided the locations and contents of it above. At the very bottom of the httpd.conf there should be a section about <VirtualHosts> which is how Apache handles multiple domains. You can configure in there a per domain policy for .htaccess as opposed to the default policy for the server (though this may not be an issue if you want .htaccess enabled on all).

    Have you tried to change the default <AllowOveride> to All to see if that works?

    You are going to have to make a change to an apache config file if you want this to work, though you may have to get someone who knows the system better than I who can talk you through it.

    Yes, I changed AllowOverride to All… didn’t help though.

    In httpd.conf in the httpd folder, I changed the AllowOverride cmd (first one that appeared) and the 2nd one too… no change.

    In another directory I found an additional httpd.conf file, and in there I found text about htaccess; I changed that one too… no change.

  • #19 / Apr 28, 2009 2:13pm

    Gareth Davies

    491 posts

    I’ll assume that you restarted Apache after all of these as well.

    only last thing I can suggest, short of getting an expert to look at your system is to find the VirtualHost entry and ensure the setting is correct there as this will override all the others in the <Directory> setting.

    You are looking for something like:

    <VirtualHost *:80>
        ServerName <a href="http://www.yourdomainname.com">http://www.yourdomainname.com</a>
        DocumentRoot /var/www/yourwebsitefolder
         <Directory  /var/www/yourwebsitefolder>
         AllowOverride All
         </Directory>
    </VirtualHost>
  • #20 / Apr 28, 2009 2:56pm

    longterm

    12 posts

    I’ll assume that you restarted Apache after all of these as well.

    only last thing I can suggest, short of getting an expert to look at your system is to find the VirtualHost entry and ensure the setting is correct there as this will override all the others in the <Directory> setting.

    You are looking for something like:

    <VirtualHost *:80>
        ServerName <a href="http://www.yourdomainname.com">http://www.yourdomainname.com</a>
        DocumentRoot /var/www/yourwebsitefolder
         <Directory  /var/www/yourwebsitefolder>
         AllowOverride All
         </Directory>
    </VirtualHost>

    I found something similar to that, but it was all commented out (and wasn’t in the “httpd” directory, but in opt/apache2/... instead. I didn’t change it because it was commented out, and i didn’t want to bring down the whole web server.

    Also, it didn’t have the AllowOverride line in it… I was about to add it and uncomment the section, but decided to be cautious instead.

    Any thoughts?

  • #21 / Apr 28, 2009 3:01pm

    Gareth Davies

    491 posts

    Don’t uncomment it - it’s there as an example should you need to use it.

    I’m out of ideas I’m afraid and don’t have the knowledge on the specifics or vagaries of the system you’re running.

    Hope someone else can help.

  • #22 / Apr 30, 2009 11:02am

    3Easy

    44 posts

    This thread contains the question as to whether anybody had removal of index.php sorted in a local MAMP environment - I can answer yes. The infamous wiki article notes, in the “File and Directory Check” method, that the removal of the first “/” mark is required with index.php located in a directory other than the root.

    RewriteEngine On 
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L]

    Preferences in my particular MAMP set-up include using Apache Port 80 and changing the default document root /Users/Account/Sites, so the ‘root’ for each project is a directory jump from the root. This may or may not be a little particular to me, but I hope it helps. Not sure if it’s worth adding to the wiki?

    Cheers,
    3Easy.

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

ExpressionEngine News!

#eecms, #events, #releases