which file do i need to hack for mod_rewrite? (5 posts)

  1. Ryan Boren
    WordPress Dev
    Posted 12 years ago #

    For 1.0.2 and earlier, change wp-admin/options-permalink.php. For nightlies, change the rewrite_rules() function in wp-includes/functions.php.
    Make sure you move that rewrite rule to the end of the list in .htaccess. It is greedy and will gobble up everything. That is why we have /category/(.*), /author/(.*), /feed/(.*), /comments/feed/(.*), and so forth. If we tried to dangle them all off the root, they would clash horribly and only the first RewriteRule would work.

  2. Stevarino
    Posted 12 years ago #

    Ack, rboren beat me.

  3. huphtur
    Posted 12 years ago #

    hrm, im unable to make this happen.
    i tried this simple test on line 145 of options-permalink.php.
    $catmatch = $front . 'TESTegory/';
    I then reapplied the permalink structure thru wp-admin
    it gave me a new .htaccess, which i uploaded.
    it still shows /category/food.

  4. Ryan Boren
    WordPress Dev
    Posted 12 years ago #

  5. huphtur
    Posted 12 years ago #

    Per the instructions of post 3298 I did the following:
    File: /wp-admin/options-permalink.php
    Find line 146: $catmatch = $front . 'category/';
    Replace: $catmatch = $front;
    File: /wp-includes/template-functions.php
    Find line 1362: $link = $siteurl . $front . 'category/' . $category_nicename . '/';
    Replace: $link = $siteurl . $front . $category_nicename . '/';
    That all worked perfect.
    Now I am having trouble with the mod_rewrite rule. I tried several different ones. Including the ones with the +. I got a lot of Server 500 errors and a lot of server 'stalls'. I even tried the mod_rewrite RewriteRule Generator which didnt help much either.
    Any idea how to format the RewriteRule?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.