• I tried to post this in the wp-advanced forum, but it said that I need to be a moderator to post there.

    Anyway, I have custom permalinks enabled, which adds the following to my .htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I have a category of posts, however, which intentionally don’t have post names (making the %postname% value empty). This causes the permalinks for those to not work. I’m trying to figure out how to create a condition that if %postname% is blank it will use %post_id% instead, but I’m definitely no pro when it comes to mod_rewrite and regular expressions. I’ve tried looking up documentation for RewriteCond, but it’s not really clearing things up for me.

    Does anybody know what rewrites I would need to add?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have no idea, but why don’t you just put the post ID in the permalink when you make the post?

    Thread Starter ianadams

    (@ianadams)

    The post ID is already in the permalink, but that permalink doesn’t work. (e.g. you click the permalink and it loads up the /archives page) That’s the problem I’m trying to solve with mod_rewrite. (Because the problem appears to be caused by the default mod_rewrite settings that WP uses.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with mod_rewrite?’ is closed to new replies.