WordPress.org

Ready to get started?Download WordPress

Forums

Permalink / mod_rewrite issues (8 posts)

  1. ronrapp
    Member
    Posted 10 years ago #

    I'm having a bit of a problem getting my WordPress 2.1 install to recognize the date based permalinks.
    The site in question is at http://stage.rapp.org/
    You'll notice the categorical archive links work fine. The monthly archives, however, do not work. I've read various messages here on the support forum about folks with internal server errors and such. I'm not having that problem. WordPress works fine, it just says "Sorry, no posts matched your criteria."
    Here is my .htaccess file:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?category_name=$1&feed=$2 [QSA]
    RewriteRule ^archives/?(.*) /index.php?category_name=$1 [QSA]
    RewriteRule ^archives/author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /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-9a-z-]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([_0-9a-z-]+)?/(feed|rdf|rss|rss2|atom)/?$ /wp-feed.php?year=$1&monthnum=$2&name=$3&feed=$4 [QSA]
    RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([_0-9a-z-]+)?/trackback/?$ /wp-trackback.php?year=$1&monthnum=$2&name=$3 [QSA]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1 [QSA]
    RewriteRule ^comments/feed/?([_0-9a-z-]+)?/?$ /wp-feed.php?feed=$1&withcomments=1 [QSA]
    My template tag permalink is: /archives/%year%/%monthnum%/%postname%/
    and my categories permalink is set to : /archives

  2. thomasmaas
    Member
    Posted 10 years ago #

  3. ronrapp
    Member
    Posted 10 years ago #

    I tried every suggestion in that thread before posting my message.
    When I remove /archives/ from the permalink path, it works. But why is that? And more importantly, how can it be fixed? Since /archives/ is listed in the example given in the control panel, I assume it has to work somehow. :)
    Thanks,
    --Ron

  4. carthik
    Member
    Posted 10 years ago #

    Change
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA]

    to
    `
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([_0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&name=$3&page=$4 [QSA]

  5. ronrapp
    Member
    Posted 10 years ago #

    2fargon,
    I made the change as you suggested. Still no dice.

  6. ronrapp
    Member
    Posted 10 years ago #

    If you visit
    http://stage.rapp.org/archives/2004/02/
    you'll see it shows "no messages met the criteria". But if you add in "index.php" to the URL, like this:
    http://stage.rapp.org/index.php/archives/2004/02/
    Then it works.
    ???

  7. ronrapp
    Member
    Posted 10 years ago #

    Thank you, Thomas! Yours was the only suggestion that worked.
    I guess the .htaccess file generated by WordPress is no good, at least for my ISP's setup (I'm with Dreamhost.com).
    Could I bug you for a little more help on one thing? In my old Movable Type setup, the postname in the URLs used underscores instead of dashes. How would I go about either a) using underscores in WP or b) having a mod_rewrite rule so the old URLs would be forwarded to the new URL?

  8. thomasmaas
    Member
    Posted 10 years ago #

    Has nothing to do with your isp. Has everything to do with having same startfolder of the URI for your categories and your permalinks: "archives".
    underscores: don't forget that google prefers dashes
    http://wordpress.org/support/4/6172 gives basically 2 solutions
    1 > plugin to create underscores
    2 > use external mod rewrite to guide visitors to new URI with dashes (imho preferable)
    good luck

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.