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.

MSM, .htaccess and "No Input File Specified"

May 04, 2011 4:09am

Subscribe [3]
  • #1 / May 04, 2011 4:09am

    wildrock

    262 posts

    Ok, I just moved an installation to a new server. Using EE 1.7.1 (updated after moving) and MSM Build: 20100805.

    Everything was working fine on the old server (except it was slow as sludge—go NetSol!). I get the site moved and configured and everything works, except the second site gives me the dreaded “No input file specified” on all but the index page. The default site works fine. I am using the following .htaccess file to point the domain alias to the subdir for the second site:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} domain2.org$ [NC]
    RewriteCond %{REQUEST_URI} !^/domain2/.*$
    RewriteRule ^(.*)$ /domain2/$1

    If I add in a “?” to the index.php (“index.php?”) in the url then all the pages display in the second site. But as the two sites are interrelated, my client isn’t too happy about having the urls display two ways, not to mention losing all the SEO work that was done on the second site.

    I toggled the cgi.fix_pathinfo=0 to cgi.fix_pathinfo=1 in the php.ini file. Didn’t help. Turned on “Force URL query strings”. Didn’t help. Toggled the “$qtype = 0;” settings around. Didn’t help. Tried various combinations of all the above. No go. Tried some different varieties of reewrite, and no love. Updated my hosting environment to Debian 6 and PHP 5.3.x. Nada.

    As this site isn’t public yet (still have the old site running, and haven’t moved dns), I’m using a hosts file (Mac OS X) entry for the new location (mapping IP to domain names) to test out the new install, but can’t really see this having an effect, as this is the way it should be done.

    I’m out of ideas. Any suggestions?

    [Mod Edit: Moved to the Community Help forum]

  • #2 / May 04, 2011 5:01pm

    Brandon Jones

    5500 posts

    Hi wildrock,

    We need to get EE working without any URL rewriting, so ahead and rename/disable .htaccess for now. Can you run through what you’ve tried again, specifically the qtype settings, without any rewriting in play?

  • #3 / May 04, 2011 6:52pm

    wildrock

    262 posts

    EE is working fine for the default site, with or without any url rewriting in the .htaccess file. I’m using MSM to serve a second site from a different domain name. It’s the second site that I’m having problems with.

    When I disable the .htaccess file, and call the second domain directly with a directory call:

    <a href="http://www.domain2.com/domain2/">http://www.domain2.com/domain2/</a> or http://www.domain2.com/domain2/index.php

    the index.php file is properly served.

    If I manually insert the proper uri like this after the subdirectory:

    <a href="http://www.domain2.com/domain2/index.php/template/entry/">http://www.domain2.com/domain2/index.php/template/entry/</a>

    the page is served fine.

    But when I call the url like it should be (with the .htaccess url rewrite):

    <a href="http://www.domain2.com/index.php/template/entry/">http://www.domain2.com/index.php/template/entry/</a>

    I get the “No input file specified” error.

    Does that narrow it down?

  • #4 / May 04, 2011 7:00pm

    wildrock

    262 posts

    Ok. Here’s another piece of the puzzle. My hosting provider (Modwest) allows for automatically setting up subdomains. So if I setup a subdomain like this (copying the root level domain2 directory up above root into the /htdocs/ directory):

    <a href="http://domain2.default_domain.com/">http://domain2.default_domain.com/</a>

    It will serve the index.php file properly. And if I manually insert proper uri paths:

    <a href="http://domain2.default_domain.com/index.php/template/entry/">http://domain2.default_domain.com/index.php/template/entry/</a>

    they serve fine (all this without any .htaccess file).

  • #5 / May 05, 2011 6:58pm

    Brandon Jones

    5500 posts

    Hi wildrock,

    Have you contacted your host about this? It sounds like domain2’s document root isn’t ./domain2, but you would like that to be the case. Rather than try to correct this with a URL rewrite it’d be easier (I think) to get the server configured properly. Keep us posted!

  • #6 / May 06, 2011 1:37pm

    wildrock

    262 posts

    Yes, I’ve contacted my host. I’ll probably run some tests and then talk with them again. They’re the ones that directed me to modify the cgi.fix_pathinfo variable in the php.ini file. This has worked with other EE sites that have had issues with the “No input file specified” error. But being as I don’t get that error on the default site, and when I toggle it, the default site starts throwing the error, I’m not sure what to make of it. If I could get the provider to do a httpd.conf mod for me to point the domain alias into the proper directory, that would probably solve the issue. But their approach to this is to handle the domain pointing inside the root with a url rewrite. I’ve tried a couple of stabs at using a Redirect 301 into a proper subdomain at ./domain2 to move the pointer, and then use a rewrite to clean up the url, but haven’t had any success yet. Somehow I think that is where the ultimate solution resides.

  • #7 / May 06, 2011 6:31pm

    Brandon Jones

    5500 posts

    That does sound like an unusual approach, and one that is error-prone so I’m surprised it’s their default to make you jump through those hoops. The ideal outcome would be changing the configuration on their side, as we can’t support specific .htaccess rules or URL rewriting. Let us know how you progress!

  • #8 / May 13, 2011 7:29pm

    wildrock

    262 posts

    Ok, after much fiddling around, I did a different variant on the rewrite, so my .htaccess looks like this:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} domain2.org$ [NC]
    RewriteCond %{REQUEST_URI} !^/domain2/.*$
    RewriteRule ^index.php(.*)$ /domain2/index.php?$1

    Basically, I told the server to rewrite index.php as index.php?. It’s transparent to the end user, and no urls are broken from search engine, and I don’t have to figure out all the intricacies of why the domain alias and a normal domain url rewrite doesn’t work like I want it to. If anybody sees a better way to do this, I’m all ears!

    thanks, JIm

  • #9 / May 14, 2011 2:38pm

    Greg Salt

    3988 posts

    Hi Jim,

    Glad that you seem to have found a solution for this problem. I can move this thread into the Community Help forum if you wish to continue optimisation - it may be that someone else has run into a similar issue. Otherwise I’ll go ahead and close this thread.

    Cheers

    Greg

  • #10 / May 14, 2011 2:55pm

    wildrock

    262 posts

    Thanks Greg. Sure move it on over.

    JIm

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

ExpressionEngine News!

#eecms, #events, #releases