• Hello. I’m trying to get clean urls to work with my installation of WordPress.

    My permalink structure is:

    /%year%/%monthnum%/%day%/%postname%/

    My .htaccess file contains:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ /index.php/$1 [L,QSA]

    And it works great for articles. The problem is that when I try to access archives, categories or tags (myurl.com/category/the_category), it generates a 404 error, since it’s interfering with the article redirect. Pages seem to work fine though. How do I tell mod_rewrite NOT to rewrite the URL if it’s a category, tag or archive link? I can’t seem to find any documentation or web page clearly documenting how to do this…

    Thanks!
    -Nate

Viewing 1 replies (of 1 total)
  • thats what ! is for 🙂

    for instance,

    RewriteCond %{REMOTE_ADDR} =24.175.114.15
    RewriteCond %{REQUEST_URI} !/idiot\.php$
    RewriteRule \.php$ http://www.village-idiot.org/idiot.php [R=301,L]

    will apply the rewrite rule to every page except idiot.php

    its used in the example above to prevent looping.

Viewing 1 replies (of 1 total)
  • The topic ‘Clean URLs and .htaccess’ is closed to new replies.