WordPress.org

Ready to get started?Download WordPress

Forums

Custom rewrite rules only work if $use_verbose_rules = true; (2 posts)

  1. mailman0
    Member
    Posted 8 years ago #

    I added the following to my theme's functions.php:

    function gallery_filter($rules) {
    $newrules['gallery/folder/(.*)'] = 'gallery/sp_index.php?dir=./$1';
    $newrules['gallery/file/(.*)'] = 'gallery/sp_index.php?file=./$1';
    $newrules['gallery/thumb/(.*)'] = 'gallery/sp_getthumb.php?source=./$1';

    $rules = array_merge($newrules,$rules);
    return $rules;
    }
    add_filter('rewrite_rules_array', 'gallery_filter');

    but it only works if I set $use_verbose_rules = true; in classes.php

    Otherwise the reltive links under gallery/ all cause the default front page of wordpress to load.

    It works, but I don't think this is how things are supposed to work.

    Many thanks to filisofo on other forums for pushing me in the right direction to get as far as I have.

  2. mailman0
    Member
    Posted 8 years ago #

    This issue seems to have been addressed in WP 2.0.2

    Yea WordPress!

    Edit: On closer inspection, I have spoken too soon. It still doesn't work properly.

Topic Closed

This topic has been closed to new replies.

About this Topic