WordPress.org

Ready to get started?Download WordPress

Forums

Rewrite category permalink (1 post)

  1. mptre
    Member
    Posted 5 years ago #

    Hi there!
    I'm trying the rewrite a couple of categories that belongs to a parent category. Here's an example where stockholm is a child of town.

    http://example.com/category/town/stockholm => http://example.com/town/stockholm

    Here's my htacess-file.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^town/([a-z]+)/?$ /index.php?category_name=$1 [L]
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    But it isn't working, it just takes me to 404.php. So I would love to get some help!

    Thanks in advantage!

Topic Closed

This topic has been closed to new replies.

About this Topic