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.

DSO / suPHP and index.php headaches

July 15, 2011 5:03am

Subscribe [4]
  • #1 / Jul 15, 2011 5:03am

    moogaloo

    200 posts

    I’ve been using a Memset VPS for a while now without problem, until I started noticing permissions problems with CE Image - it turned out that the server was set up using DSO PHP and so newly made files were being created with no user:group and so set to 99:99 which meant deployments would stop working.

    I got my server switched over to suPHP to resolve the user:group permissions errors (which it has done) but it’s introduced other problems.
    A series of sites in development have all stopped working in terms of the URLs re-writing. The htaccess file I’d been using was no longer redirecting pages correctly, eg sitename.com/about was staying on the home page, eg http://www.mdwntr.com/profiles/julieta_lopes

    Incidentally, if I use http://www.mdwntr.com/index.php/profiles/julieta_lopes as the URL, the page does work.

    The standard htaccess file I use is:

    # secure .htaccess file
    <Files .htaccess>
    order allow,deny
    deny from all
    </Files>


    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /

    #################################################################

    # Add a trailing slash to paths without an extension
    # Does not redirect for POST items like SafeCracker and the comment form
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
    RewriteRule ^(.*)$ $1/ [L,R=301]

    # Remove index.php
    RewriteCond %{QUERY_STRING} !^(ACT=.*)$ [NC]
    RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5})$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) /index.php/$1 [L]

    #################################################################
    # AddHandler php5-script .php


    ...but I’ve tried various other .htaccess files including very cut down ones to just the index.php rewrite, using the index.php? and using [L,R], none solve the problem.

    I’ve also noticed that other sites on my server are not breaking, specifically sites that were built before I started using NSM bootstrap to handle deployments. If I take a site that isn’t working correctly and remove the bootstrap file (and remove the extra line from the bottom of system/expressionengine/config/config.php and database.php ),  those sites do now work.

    I’ve been in touch so far with:
    various EE devs
    Memset (hosting)
    cPanel
    NSM
    ...no one is able to figure out what is going on.

    I know this probably shouldn’t be in the EE tech support section as you dont support index.php rewrites, so please feel free to move it to where it should be - I couldn’t see the right place.

    If anyone has any idea what is going on, I would be massively grateful as it’s holding several sites up from going live.

  • #2 / Jul 15, 2011 2:31pm

    Rob Allen

    3114 posts

    You may need to add a ? to the last Rewrite line

    This works on my server which runs SuPHP…

    RewriteRule ^(.*)$ /index.php?/$1 [L]

  • #3 / Jul 15, 2011 4:11pm

    Kevin Smith

    4784 posts

    Hey moogaloo,

    Actually, we do support removing index.php now, though the scope of support we provide for it is narrowed to the kind of URL rewriting prescribed in the User Guide. You’re right, though, that with all the extra stuff going on with your setups, this would be better suited for the Community Help forum. Specifically, I would be looking at NSM Bootstrap as the problem area, since removing it seems to alleviate the problems. That’s where I’d focus my troubleshooting anyway.

    Did bluedreamer’s suggestion help?

  • #4 / Jul 15, 2011 11:04pm

    the3mus1can

    426 posts

    In the system/expressionengine/config/config.php file try switching between the different options for $config[‘uri_protocol’].  I believe it is set by default to ‘AUTO’ which usually really means ‘QUERY_STRING’. Try using REQUEST_URI or PATH_INFO. If you are using the NSM Bootstrap you might have to change the uri_protocol in there though.

  • #5 / Jul 19, 2011 9:00am

    moogaloo

    200 posts

    OK - thanks for the suggestions guys - will try some of them out and get back to you all.

  • #6 / Jul 20, 2011 6:32am

    moogaloo

    200 posts

    Brilliant - it works!!!

    In the end it was changing ‘uri_protocol’ => ‘REQUEST_URI’, (it was set to PATH_INFO)
    and making sure the .htaccess file was working fine - I used RewriteRule (.*) /index.php/$1 [L]

    Wow - can’t believe after 3 weeks of frustration it all came down to that.
    Live and learn people!

    And the3mus1can - do you have a coffee donation PayPal account I can top up to say thanks?

  • #7 / Jul 20, 2011 9:08am

    the3mus1can

    426 posts

    No worries - glad I could help.

  • #8 / Jul 20, 2011 9:18am

    moogaloo

    200 posts

    Cool 😊

  • #9 / Apr 13, 2012 8:25am

    Ruben NL

    2 posts

    Hi,

    I have the same problem over here. I followed the instructions in this topic. But i still don’t get it working. I have the same .htaccess file, but I’m afraid I put it in the wrong map or place or whatsoever.

    my .htaccess file is in the topfolder with the index.php and admin.php.

    and the config file settings:

    /*
    |--------------------------------------------------------------------------
    | Index File
    |--------------------------------------------------------------------------
    |
    | Typically this will be your index.php file, unless you've renamed it to
    | something else. If you are using mod_rewrite to remove the page set this
    | variable so that it is blank.
    |
    */
    $config['index_page'] = "index.php";
    
    /*
    |--------------------------------------------------------------------------
    | URI PROTOCOL
    |--------------------------------------------------------------------------
    |
    | This item determines which server global should be used to retrieve the
    | URI string.  The default setting of "AUTO" works for most servers.
    | If your links do not seem to work, try one of the other delicious flavors:
    |
    | 'AUTO'   Default - auto detects
    | 'PATH_INFO'  Uses the PATH_INFO
    | 'QUERY_STRING' Uses the QUERY_STRING
    | 'REQUEST_URI'  Uses the REQUEST_URI
    | 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
    |
    */
    $config['uri_protocol'] = "REQUEST_URI";
  • #10 / Apr 13, 2012 9:01am

    the3mus1can

    426 posts

    Did you also try $config[‘uri_protocol’] = “PATH_INFO”;  or $config[‘uri_protocol’] = “ORIG_PATH_INFO”; ?

    Your .htaccess file is in the right place.

  • #11 / Apr 13, 2012 9:08am

    Ruben NL

    2 posts

    Did you also try $config[‘uri_protocol’] = “PATH_INFO”;  or $config[‘uri_protocol’] = “ORIG_PATH_INFO”; ?

    Your .htaccess file is in the right place.

    I changed it to ORIG_PATH_INFO. But now no page wants to load and the link still has index.php in it.

    I think I really miss something somewhere, but I really do not know where to look for anymore.

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

ExpressionEngine News!

#eecms, #events, #releases