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.

Include Method Not Working

June 09, 2009 6:31pm

Subscribe [2]
  • #1 / Jun 09, 2009 6:31pm

    medic119

    52 posts

    Ok, I followed every step in the KB Article for the Include method of removing the index.php file.  I did it twice.  I double checked every parameter, the path.php file, etc to make sure I had no references to index.php. 

    However, none of this works.  When I click a link instead of .htaccess “adding” the index.php, it just reloads the default template.  The link in the address bar shows without index.php, but it just continues to load the “index page” of the site.  If I manually add the index.php back into the link, it works perfectly.

    I must be doing something wrong therefore I submit my .htaccess file for your help.

    AddHandler application/x-httpd-php5 .php
    
    RewriteEngine on
    
    Options +FollowSymlinks
    
    ErrorDocument 400 <a href="http://www.ffpblog.com/system/400">http://www.ffpblog.com/system/400</a>
    ErrorDocument 401 <a href="http://www.ffpblog.com/system/401">http://www.ffpblog.com/system/401</a>
    ErrorDocument 403 <a href="http://www.ffpblog.com/system/403">http://www.ffpblog.com/system/403</a>
    ErrorDocument 404 <a href="http://www.ffpblog.com/system/404">http://www.ffpblog.com/system/404</a>
    
    RewriteEngine On
    RewriteCond $1 ^(member|system|search|ffp|s|scrapbook|desert|ffp_public|mobile|Export|old|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]
    
    RewriteCond %{HTTP_HOST} ^old.ffpblog.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.old.ffpblog.com$
    RewriteRule ^(.*)$ "http\:\/\/www\.ffpblog\.com\/index\.php\/old" [R=301,L]
    
    **Blah Blah EE Blacklist stuff

    That’s it!  and I did make sure there were no refereences to index.php in the configurations of the weblog and system, as well as the config.php and path.php. 

    Oh and my ee /system directory has been renamed so its not conflicting with the “system” listed in the rewite code.

    Thanks.

  • #2 / Jun 09, 2009 7:05pm

    Ingmar

    29245 posts

    medic119, there’s a reason we don’t support it officially. Not all servers allow it, and not all methods work on all servers. My suggestion would be to try one of the other methods. Or perhaps you need to force query strings? Moving to Howto.

  • #3 / Jun 09, 2009 7:08pm

    Greg Aker

    6022 posts

    Greetings!

    I’m sorry, but due to the wildly-varying nature of server setups and configurations, removal of index.php through .htaccess is something we can not officially support.  I would recommend that you experiment with other methods listed in the Wiki entry, and if worse comes to worse, as what would work best on their servers.

    Shifting over to ‘how to’ for community input.

    Regards,

    -greg

    Eta:  Ingmar beat me!  😊

  • #4 / Jun 09, 2009 7:27pm

    medic119

    52 posts

    OK guys, understood. 
    FYI I am on Bluehost if that helps anyone.

    Also I do have the Include method working now using the LG.htaccess.generator.  It set it up really well, but now I am getting malformed CSS URLS and my CSS IS being dropped out unless I hardcode it.

    The EE Generated CSS is http://www.ffpblog.com/?css=group/site_css
    this doesn’t work for some reason.  EE seems to need http://www.ffpblog.com/index.php/?css=group/site_css to work.

    I tried the CSS Fix in the KB Article, but it I am not real .htaccess smart and it broke other things without fixing that.  Of course if someone would look over the code generated and tell me where to fit it in so it will work or how to fix it, i would be most appreciative.

    (Man I have asked for a lot of help today)

    Thanks

    # -- LG .htaccess Generator Start --
    
    # .htaccess generated by LG .htaccess Generator v1.0.0
    # <a href="http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/">http://leevigraham.com/cms-customisation/expressionengine/addon/lg-htaccess-generator/</a>
    
    # secure .htaccess file
    <Files .htaccess>
     order allow,deny
     deny from all
    </Files>
    
    # Dont list files in index pages
    IndexIgnore *
    
    # EE 404 page for missing pages
    ErrorDocument 400 <a href="http://www.ffpblog.com/index.php?/system/400">http://www.ffpblog.com/index.php?/system/400</a>
    ErrorDocument 401 <a href="http://www.ffpblog.com/index.php?/system/401">http://www.ffpblog.com/index.php?/system/401</a>
    ErrorDocument 403 <a href="http://www.ffpblog.com/index.php?/system/403">http://www.ffpblog.com/index.php?/system/403</a>
    ErrorDocument 404 <a href="http://www.ffpblog.com/index.php?/system/404">http://www.ffpblog.com/index.php?/system/404</a>
    
    # Simple 404 for missing files
    <FilesMatch "(\.jpe?g|gif|png|bmp)$">
      ErrorDocument 404 "File Not Found"
    </FilesMatch>
    
    RewriteEngine On
    
    RewriteBase /
    
    # remove the www
    RewriteCond %{HTTP_HOST} ^(www\.$) [NC]
    RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    # Add a trailing slash to paths without an extension
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule ^(.*)$ $1/ [L,R=301]
    
    # Remove index.php
    # Uses the "include method"
    # <a href="http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method">http://expressionengine.com/wiki/Remove_index.php_From_URLs/#Include_List_Method</a>
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} ^/(system|search|ffp|s|scrapbook|desert|ffp_public|mobile|Export|old||members|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    # Remove IE image toolbar
    <FilesMatch "\.(html|htm|php)$">
      Header set imagetoolbar "no"
    </FilesMatch>
    
    
    
    # -- LG .htaccess Generator End --
  • #5 / Jun 11, 2009 1:03pm

    medic119

    52 posts

    Any help?  I don’t want to have to hardcode my CSS lines through all the different template groups I use in order to get my Styling back.  I did that as a temporary fix for the main site templates already.

    Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases