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.

404s and Template Segments or Removing index.php Problem?

June 15, 2011 11:23am

Subscribe [3]
  • #1 / Jun 15, 2011 11:23am

    haggis

    70 posts

    Installation is a two-site MSM, where one uses an EE forum and the other uses IPB forum, both are installed in a subdirectory /forum/.

    member.example.com -> 404 handling OFF (turning ON conflicted with CSS switching)

    http://www.example.com -> 404 handling ON, strict OFF

    Problem is that I can’t seem to access my IPB control panel any more.

    member.example.com/forum -> EE forum -> all is well

    http://www.example.com/forum -> IPB forum -> forum appears to be running normally

    http://www.example.com/forum/something/index.php  -> 404 page trying to reach control panel

    Additional info: in addition to a handful of 301 redirects from an old site structure, I have the following in htaccess for index.php removal.

    RewriteRule modules/(.+)/controllers/(.+)\.php$ /index.php?/$1/$2 [L,R=301]
    RewriteRule controllers/(.+)\.php$ /index.php?/$1 [L,R=301]
     
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

    (I don’t actually know what the first two lines are for and can’t remember at the moment when or why I pasted them in there.)

    I swear this all seemed to be working fine for at least a week or more, when I cautiously brought up the www site as a live MSM instance - I was very surprised this morning when I suddenly could not access my IPB forum CP. I’m concerned maybe it was only working due to caching somehow and that at any moment the public (IPB) forum will disappear behind a wall of 404s too.

    Any help in understanding the mechanism of why this is happening - and/or tips for sneaking around it - greatly appreciated.

  • #2 / Jun 16, 2011 6:44am

    John Henry Donovan

    12339 posts

    haggis,

    I am not familiar with the IPB forum but if you are using forums as a URL segment for both there may be an issue there.

    Can you try and disable your htaccess temporarily to see if that works for you.

    Do you have strict URLs turned on?

  • #3 / Jun 16, 2011 7:07pm

    haggis

    70 posts

    Thanks for the pointer to htaccess - that was the right path to snoop down.

    Well it turned out that the redirects happen regardless of whether there is/was ANY 404 handling at all. Disabling the site htaccess caused server errors when trying to access the forum control panel. But .... hmmm, looky here… there is *also* an htaccess in the forum ‘system’ directory, and disabling that fixes the problem.

    However the htaccess protects the system directory (I’ve been hacked twice - others had been hacked repeatedly - all of us the same way)  and adding ‘AuthUserFile and Require valid user’ password protection stops it from recurring. Not sure how or why that authorization triggers a redirect.

    Regardless, I changed the location of the .htpasswd file to somewhere completely out of any domain paths, and lo, it appears to be working for now.

    Thanks again for the pointer to htaccess - that was the right path to snoop down.

  • #4 / Jun 17, 2011 4:19pm

    Brandon Jones

    5500 posts

    Thanks for sharing the solution, haggis! Glad you got it tracked down.

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

ExpressionEngine News!

#eecms, #events, #releases