[wp-hackers] Apache/mod_rewrite and Permalinks

Andrew Nacin wp at andrewnacin.com
Sat Oct 16 14:10:12 UTC 2010


On Sat, Oct 16, 2010 at 9:19 AM, Louis McCoy <louie at louiemccoy.com> wrote:

> Hey everyone.
>
> So last night I killed a kitten when I hacked core. I know, I'm sorry. Now
> that I have a minute to solve the problem properly, I wanted to turn to
> people smarter than me (you guys) for advice / help. On one of my servers,
> I
> had just installed WordPress 3.0.1 to set up a new site for a client. I
> went
> to go set up Permalinks, and I was met with a blank page. Being a new
> install, there aren't any plugins for me to disable, so I turned to google
> (like ya do) for answers.
>
> I found this thread:
>
> http://wordpress.org/support/topic/blank-permalink-admin-page-after-changing-permalink-type
>
> And tried the whole deleting / changing the permalink setting from inside
> the wp database to no avail. But, at the (almost) end of the thread,
> *zeniph
> *posts some code for hacking core that solves the problem. Understanding
> that this is TERRIBLE, I was out of time and did it on the offchance that
> it
> would work - lo and behold, I have access to the Permalinks page again.
>
> So since the code forces mod_rewrite to be detected, clearly the problem
> lies with either my build of Apache and reporting mod_rewrite, or with
> wordpress detecting mod_rewrite wrong. Has anyone else experienced this
> issue, or have any insight? Is this maybe a bug relating to a specific
> version of apache / php?
>
> FWIW, I'm running Apache 2.2.16 and PHP 5.3.3 and yes, mod_rewrite is
> installed.
>
> Thanks so much!


Hi Louie,

Three things:

1. Thank you for your confession. :-)

2. WordPress tries to check for mod_rewrite in two ways: first, whether PHP
believes the module is loaded. Second, it literally looks in phpinfo() to
see if it is loaded. You should run phpinfo() and see whether mod_rewrite is
even listed (or if the function is enabled on your host, as we've seen it
disabled). Something is definitely going really wrong with regards to the
blank page, and I think it's due to phpinfo(8) -- I've seen a similar error
recently. I'm tempted to have us error-suppress that at this point so I'll
look into that.

3. There's a third way. There's a filter in got_mod_rewrite() that you can
use to force it to true. I've posted a plugin in the thread:

<
http://wordpress.org/support/topic/blank-permalink-admin-page-after-changing-permalink-type/page/2?replies=46#post-1742457
>

Thanks,
Nacin


More information about the wp-hackers mailing list