Support » Installing WordPress » WordPress .htaccess file breaks webdav

  • Resolved lbutler

    (@lbutler)


    the .htaccess file that wordpress creates prevents any webdav access to the wordpress folder or any folder under it. If I move the .htaccess file aside, webdav works. Since the user needs to be able to add images to the themes folder, this is not working.

    Is there some way I can adjust the htaccess file so that webdav will work AND so that it does not get blow-away on every update?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator cubecolour

    (@numeeja)

    Have a look at Jeffrey Harrell’s plugin. Although its for enabling iCal calendar publishing, it should help with any WebDAV application.
    http://jeffreyharrell.com/projects/ical-publish-plugin/

    Thread Starter lbutler

    (@lbutler)

    I had found that, but didn’t know if it would work. However, trying to upload it gives me:

    Incompatible archive PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

    That is downloading directly from that site. I can try installing the php file (inside the .tar.gz file) directly, but since it says WordPress 2.1+ I am a little hesitant.

    Thread Starter lbutler

    (@lbutler)

    OK, went ahead and installed it anyway. It does nothing to the .htaccess file at all, even after going in and saving a post (Updating). I looked at the code and it looked like the line it was adding was, essentially, this:

    RewriteCond %{REQUEST_URI} !^/(‘wp-content’)

    (there were more things in the ” in the default script)

    but adding that line into the .htaccess manually didn’t seem to have any affect.

    .htaccess
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(‘wp-content’)
    RewriteRule . /index.php [L]
    RewriteRule ^u/([0-9]+)$ wp-content/plugins/short-url-plugin/u.php?$1|$2
    </IfModule>
    ##EOF

    Thread Starter lbutler

    (@lbutler)

    I solved this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{HTTP_HOST} !^webdav
    RewriteRule . /index.php [L]
    RewriteRule ^u/([0-9]+)$ wp-content/plugins/short-url-plugin/u.php?$1|$2
    </IfModule>

    My webdav is setup as http://webdav.example.com/ so the various REQUEST_URI variations simply didn’t work.

    The trouble now is how to make sure that that line stays in. For now, I am making the htaccess file owned by root so that WordPress cannot alter it. Not ideal, I know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress .htaccess file breaks webdav’ is closed to new replies.