469,150 Members | 1,988 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,150 developers. It's quick & easy.

Clean Urls Suddenly Not Working - No Input File Specified

35
I've been using apache and php to create clean urls for a while, and suddenly the other day it just stopped working. My host is godaddy.com and I think this might be the source of my trouble, but I'm not sure what exactly that trouble is. Here is my .htaccess file:
Expand|Select|Wrap|Line Numbers
  1. AddHandler x-httpd-php5 .php
  2. AddHandler x-httpd-php .php4
  3.  
  4. <FilesMatch "^comic$|^post$|^characters$|^extras$">
  5.     ForceType application/x-httpd-php
  6. </FilesMatch>
  7.  
I have a vague understanding of how this works (it was a cut and paste on my part I'm sorry to say - this just seems to go over my head every time I try to get it, and before now, it simply worked). From what I know of it, it looks for the words comic, post, characters, or extras, and adds .php to the end of them internally so it can be recognized as a valid page. My php page explodes the URL (which is in the form of, say, sitename.com/folder/comic/1), and puts that in an array (so 1, which is the comic_id, would be array[3]). I am fairly certain the php end of things is fine, and that it's apache/.htaccess giving me trouble since I simply get the message "No input file specified." when I try to use a clean url (index pages load fine).

This was working fine as early as last week (I think - I've been pretty busy lately), but is suddenly not.

Anyone see where my mistake is, or is this something godaddy may have changed on their end that's making this not work?
Mar 19 '08 #1
3 3684
d3vkit
35
I've decided to scrap my previous method and try my hand at actual mod_rewrites - but am running into the same issue.

Expand|Select|Wrap|Line Numbers
  1. RewriteRule ^http://www.site.com/directory/fake_dir/([0-9]+)/$ http://www.site.com/directory/index.php?id=$1
  2.  
From what I understand, this ought to take anything such as site.com/dir/fake_dir/1 and make it site.com/dir/index.php?id=1, but I'm still get a no input file specified error. My host, godaddy, runs PHP as CGI and not a module, maybe that's the problem? It specifically says in help:
For security reasons, we run PHP as a CGI and not as a module. Because of this and the version of Apache we run (1.3.3), you cannot use extensionless PHP files on your Web site without employing a tool like mod_rewrite.
But I AM using mod_rewrite. It seems it's just not seeing the fake_dir (since it doesn't exist) - I was hoping it would simply try to find what I was mod_rewriting to. I'm so new to this, it's hard to tell if I'm doing things right. Any suggestions?
Mar 20 '08 #2
d3vkit
35
Well, I figured it out, and thought I'd share the little things I had done wrong just in case this comes up in a Google search or something.

1. I upgraded my hosting to Deluxe Linux with multiple hosting, so I can seamlessly use folders in my root and direct my different domains to those folders. I realized later on that .htaccess will take care of this with a little work, but I suppose the extra $3 a month is worth making it easy.

2. I had multiple .htaccess files (this one is pretty stupid). I normally will take an old file and simply put .OLD on it, so it doesn't register but I don't have to delete in and I can just upload my new file. I think this messed things up since .htaccess starts with a period. This probably won't come up for anyone but me :P

3. I was trying to have fake directory's but I had FILES with those directory names - such as site.com/fake_dir/id, and I had a file called fake_dir.php. It was trying to use that, not sure why. (I had previously been using a different method which involved having these files with includes of the index. They were useless after I figured out how to do actual mod_rewrite.)

After fixing each of these things, I have mod_rewrite working great, and am really happy with the level of control I have now.
Mar 24 '08 #3
jkspin
1
Hi! I have deluxe hosting with GoDaddy, and have not been able to get clean urls working on any of my 'sub' sites (in folders in root). If you have had success I would really appreciate knowing how you have got it to work. I've tried lots of different .htaccess permutations with no success so far.

Thanks, John S.
Jun 5 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by somaboy mx | last post: by
7 posts views Thread by Creative Acceleration | last post: by
12 posts views Thread by melanieab | last post: by
26 posts views Thread by Robert Baer | last post: by
5 posts views Thread by fakeprogress | last post: by
10 posts views Thread by jflash | last post: by
8 posts views Thread by raamay | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.