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.
huphtur
Member
Posted 8 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.
huphtur
Member
Posted 8 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?