create relative url for category and subcategory in wordpress
<p>There is problem in wordpress url. I have created custom post-type and custom-taxonomy. When i click on category then following url is appear in url bar.</p>

<pre><code>root/product-category/category
</code></pre>

<p>When in click on subcategory then it shows tha following url.</p>

<pre><code>root/product-category/subcategory
</code></pre>

<p>But i want to show following url,</p>

<pre><code>root/product-category/category/subcategory
</code></pre>

<p>Here is code for custom post type,</p>

<pre><code>    add_action('init','rf_main_products');
function rf_main_products(){
    $args=array
        (
            'labels' =&gt; array(
                'name' =&gt; __('Products'),
                'singular_name' =&gt; __('Product'),
                'add_new' =&gt; __('Add New Product'),
                'add_new_item' =&gt; __('Add New Product'),
                'edit_item' =&gt; __('Edit Product'),
                'new_item' =&gt; __('New Product'),
                'view_item' =&gt; __('View Product'),
                'search_items' =&gt; __('Search Product'),
                'not_found' =&gt;  __('No Product found'),
                'not_found_in_trash' =&gt; __('No Product found in Trash'),
            ),
            'public' =&gt; true,
            'has_archive' =&gt; true,
            'rewrite' =&gt; array('slug' =&gt; 'mainproducts'),
            'supports'=&gt;array('title','editor','thumbnail'),
            'hierarchical'=&gt;true,
            'taxonomies'=&gt;array('main_product_category','tags')
        );
    register_post_type('rf_main_products',$args);
}
</code></pre>