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.

.htaccess breaks site link in control panel?

October 10, 2012 12:59pm

Subscribe [2]
  • #1 / Oct 10, 2012 12:59pm

    Frank Harrison

    154 posts

    Hi all

    I’ve got a site that uses a fairly customised .htaccess file - the host (34SP) edited the default one to get a few things (mainly removing index.php) working. It now looks like this:

    <IfModule mod_rewrite.c>
    
        # Enable Apache's RewriteEngine
        RewriteEngine On
    
        # Add Trailing Slashes to URLs
        RewriteCond %{REQUEST_METHOD} !=POST
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.+[^/])$ /$1/ [R=301,L]
    
        # ExpressionEngine Remove index.php from URLs
    #    RewriteCond %{REQUEST_METHOD} !=POST  <- I COMMENTED THIS OUT MYSELF TO GET FORMS WORKING
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
    </IfModule>

    My client’s just noticed that the link in the top right of the control panel which takes you to the front-end of the site doesn’t work. Clicking it takes you to http://www.mysite.com/?URL=http://www.mysite.com/ - I guess that’s where it’s meant to point, but then EE’s meant to do something clever and pass that on to http://www.mysite.com/ ?

    My first guess was that something we edited in the .htaccess file might have broken that functionality. Any ideas? I’m pretty stupid with .htaccess and I’m not sure how EE handles that link, so not really sure where to start!

    Thanks, Frank

  • #2 / Oct 12, 2012 12:18pm

    Kevin Smith

    4784 posts

    Hi Frank,

    In terms of the .htaccess file, we can only offer limited support, but let’s take it out of the picture completely and see what the behavior is. Could you temporarily disable it, add index.php back into the your URLs (reverse this step), and let me know what the behavior is?

  • #3 / Oct 15, 2012 11:23am

    Frank Harrison

    154 posts

    Hi Kevin

    Looks like my guess was wrong - just removed the .htaccess rules and added index.php back, and the same thing - I click on the link and I go to http://www.mysite.com/index.php?URL=http://www.mysite.com/index.php which is again a blank page, and it doesn’t forward to http://www.mysite.com/index.php. Any ideas what else could be stopping this from working?

    Thanks, Frank

  • #4 / Oct 16, 2012 11:08am

    Robin Sowell

    13255 posts

    Odd.  What should be happening- if the url has URL in the get- it opens libraries/Redirect.php.  That should dump a string and exit.  If you look at the source of the blank page- is it blank too?  Or is there content a la

    "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>\n<title>Redirect</title>\n". etc….

    And if it’s blank…. If you edit system/expressionengine/libraries/Redirect.php at the very top:

    if ( ! isset($_GET['URL'])) 
    { 
     exit();
    }
    
    change exit(); to
    
     exit('Failed redirect');

    Either of those give us a hint as to where it’s failing?

  • #5 / Oct 16, 2012 12:19pm

    Frank Harrison

    154 posts

    Hi Robin

    The source code is blank. I just tried editing system/expressionengine/libraries/Redirect.php and get the same thing - blank page, blank source code. Does that help?

    Thanks, Frank

  • #6 / Oct 17, 2012 10:48am

    Robin Sowell

    13255 posts

    Hrm- no.  LOL.  I’m dropping you an email as I think we may need to take a closer look.  Odd one!

  • #7 / Oct 19, 2012 5:44am

    Frank Harrison

    154 posts

    Thanks Robin. Just responded to that!

  • #8 / Oct 22, 2012 5:22pm

    Shane Eckert

    7174 posts

    Hello,

    To anyone following this thread, we are working with Frank in private support and will report back here with anything we find.

    Thank you,

  • #9 / Oct 23, 2012 5:23pm

    Kevin Smith

    4784 posts

    Looks like the trouble on this one was an outdated version of the site’s main index.php file. Resolved!

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

ExpressionEngine News!

#eecms, #events, #releases