By Poolio on
all of a sudden, all of my automatically generated links are including index.php.
what used to http://www.mysite.com/?q=sample is now http://www.mysite.com/index.php?q=sample
anyone know why this would be happening? my site has been running Drupal (4.4.x) for several months, and this suddenly occurred, without my doing anything which would've caused it.
Comments
A few questions
Do you run the server that hosts your site? If not, the main apache server config file or .htaccess files may have been changed by your hosting company. Can you take a look at them?
What's the .htaccess file look like in the root of your drupal directory?
---
Don't use Microsoft software
thanks for the info
that's what I suspected the problem was. I've contacted my hosting company and asked them to look into it.
Put your money where your mouth is!
just heard back from my host
they said no changes were made to the apache server log or .htaccess file. they did, however, tell me that php was upgraded to 4.3.10
could this be the root of the problem?
Put your money where your mouth is!
Maybe...
I took a quick look through the Drupal 4.4 code and found this:
<?
/*
** On some webservers such as IIS we can't omit "index.php". As such we
** generate "index.php?q=foo" instead of "?q=foo" on anything that is not
** Apache.
*/
$script = (strpos($_SERVER["SERVER_SOFTWARE"], "Apache") === false) ? "index.php" : "";
?>
From only a quick search this seems the most likely culprit if it's a Drupal-related issue. What I suggest is making a little test.php page with only the code to print the SERVER_SOFTWARE string. I guess something like
<? print $_SERVER["SERVER_SOFTWARE"]; ?>
Maybe it's now returning "Apache" in all uppercase or something like that. If so, you may want to submit it as a low priority issue to Drupal core. It doesn't break Drupal, but it does change how it acts slightly.
You can make the change in your copy of drupal by editing function url in file includes/common.inc.
---
Don't use Microsoft software
thanks a lot
I changed this:
to this:
getting rid of "index.php" seems to have done trick.
Put your money where your mouth is!
Sure
Sure, just don't switch to Microsoft IIS or your site will stop working. :)
You can actually delete that little "if" section if you like. $script should remain blank in your case anyway, so no need to perform the check at all.
I'm just a little anal about clean code. I can't help myself.
---
Don't use Microsoft software
done :)
I don't have any plans to switch hosting companies, but if I do, I'll keep that in mind.
thanks again for your help.
Put your money where your mouth is!