Support » Fixing WordPress » I’m losing sleep over this

  • Yes, another permalink problem post. I know, I know – there are a blue million of these posts already (I know this because I read most of them last night because I couldn’t sleep for trying to figure this out). Permalinks result in a 404 error, best that I can tell.
    http://www.moravianchurch.org/webpress
    First off, I know it should be able to work – I had the permalinks working when I first installed WordPress on the church’s site. But then, i screwed it up – and after reinstalling I can’t get the permalinks to work.
    Hard to figure out, but it seems like to me that the mod_rewrite is working – the links seem to be pointing to the right URI. Is it possible that there is something wrong with my WordPress install, so that it can’t “handle” the permalink?
    I really, really need someone to help me figure this out. Here is my .htaccess file:
    <code>RewriteEngine On
    RewriteBase /
    RewriteRule ^webpress/archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^webpress/archives/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^webpress/archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^webpress/archives/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^webpress/archives/?([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^webpress/archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^webpress/archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /webpress/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1&withcomments=1 [QSA]
    </code>
    Things that I have tried:
    I have tried to put the “path to home” in the second line of the .htaccess file.
    Permissions are set to 766.
    Tried to include “index.php” option, but that still seems to send an address that confuses WordPress.
    I have tried swearing at the screen, too.
    If anyone has the time to help me through this, there are some Moravian cookies headed your way. If you haven’t had them yet – believe me, they are well worth it. 😉
    Thanks,
    Hal Atkins

Viewing 13 replies - 1 through 13 (of 13 total)
  • It definately appears to be a rewrite problem…
    If I’m not mistaken, the line
    RewriteBase /
    should read:
    RewriteBase /webpress/
    Try that and let us know what happens. 🙂

    Okay, try number two:
    RewriteEngine On
    RewriteBase /webpress/
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /index.php?author_name=$1 [QSA]
    RewriteRule ^archives/?([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /webpress/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1&withcomments=1 [QSA]

    As an aside, anyone know the purpose of RewriteBase? The documentation says it’s to translate between physical and virtual paths, but I can’t see this coming into play with a WP weblog…

    Well, that’s interesting. Didn’t get a 404 error with that one – but it seems like it tried to call the “index.php” that is at the top level of my site. In other words, the permalink went after:
    moravianchurch.org/index.php
    when it should be going after index.php that’s in the “webpress” directory:
    moravianchurch.org/webpress/index.php
    Stevarino, I can’t tell you much I appreciate you trying on this. Any more ideas?

    Hm, it seems to be double encoding the ampersands….
    RewriteEngine On
    RewriteBase /webpress/
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /webpress/index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /webpress/index.php?author_name=$1 [QSA]
    RewriteRule ^archives/?([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /webpress/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/(feed|rdf|rss|rss2|atom)/?$ /webpress/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^archives/?([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)/trackback/?$ /webpress/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /webpress/wp-feed.php?feed=$1&withcomments=1 [QSA]

    Thanks again, Stevarino – but still to no avail. Is there anyway to get in and diagnose the thing?
    By the way, what did you mean about double-encoding the ampersand?
    Hal

    Is there a way to turn permalinks off?

    You seem to have permalinks working now, but to turn them off, just undo what you did to create them – delete the structure, update and then delete the appropriate permalink section in htaccess.

    Holy cow. It just started to work.
    These things, I just don’t understand.
    Stevarino – I owe you some cookies. Thanks a bunch!

    Have you guys tried http://paste.uni.cc/? It’s a great way to post some code, and to get a nice short reference number to post.
    It’s preferred to do this over long threads of code here in the forums.
    🙂
    Craig.

    I’m having the exact same errors with this thing. I’ve followed the steps, tried the code you guys went through above, but no luck. I get 404 whenever I even try to go to the message from within the admin interface.
    One of the codes did the same thing and bounced me back to my index page at my root, but that’s the most adventurous anything has worked on this “archive” part.
    Here’s the .htaccess I’m using – and assuming it’s supposed to be at the root of the /wordpress/ folder?
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^archives/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/category/?(.*) /wordpress/index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?author_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/author/?(.*) /wordpress/index.php?author_name=$1 [QSA]
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?([0-9]+)?/?$ /wordpress/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)?/(feed|rdf|rss|rss2|atom)/?$ /wordpress/wp-feed.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([_0-9a-z-]+)?/trackback/?$ /wordpress/wp-trackback.php?year=$1&monthnum=$2&day=$3&name=$4 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wordpress/wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wordpress/wp-feed.php?feed=$1&withcomments=1 [QSA]

    Nick, wish I could “pay it forward” and help you – but I can’t. I put in the code that Stevarino gave me, and at first it didn’t work. Checked back 15 minutes later, and it did work. It’s got a life of its own.
    I can say that, yes, it does need to be in the “wordpress” directory. Good luck.

    @nickm – can we have a url ?

    Unfortunately, it’s behind a members area, so the link wouldn’t work unless you signed up anyway. Other thoughts?

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.