Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Having a bugger of a time with this one... not sure if it's a bug in DirectAdmin's scripting or something in HTTP or PHP that is causing the issue.

Site is hosting a WP installation... basically any query string throws a 404 (ie. admin-ajax?something=1) while the bare PHP file (admin-ajax.php) executes properly (in this case returning 0).

While it could be a bug in PHP or Apache, I'm suspecting the DirectAdmin built .htaccess for the virtualhosts. I'm not .htaccess guru, so here for your viewing pleasure is the auto-generated code

<VirtualHost x.x.x.x:8080 >

    ServerName www.example.com
    ServerAlias www.example.com example.com
    ServerAdmin webmaster@example.com
    DocumentRoot /home/admin/domains/example.com/public_html
    ScriptAlias /cgi-bin/ /home/admin/domains/example.com/public_html/cgi-bin/

    UseCanonicalName OFF

    <Directory /home/admin/domains/example.com/public_html>
            RewriteOptions InheritBefore
            RewriteCond %{REQUEST_FILENAME} -f
            RewriteCond %{REQUEST_FILENAME} \.php$
            RewriteRule ^/?(.*\.php(/.*)?)$ fcgi://socket=\%2fusr\%2flocal\%2fphp53\%2fsockets\%2fadmin.sock/home/admin/domains/example.com/public_html/$1 [P,E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Hopefully an .htaccess wizard can chime in and end this Google torture I've been undergoing for the past few hours!

share|improve this question
Did you try enabling mod_rewrite's log to see what's happening on those requests? httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritelog –  El Barto Sep 12 '13 at 16:35
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.