Rewrite rules modify a web URL's appearance. This modification is called URL rewriting. Rewritten URLs (sometimes known as short, fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of ...

learn more… | top users | synonyms

1
vote
1answer
2k views

How to fix pagination after rewriting url? ie. www.site.com/players/type/pro/page/3/

I have a custom post type of players, and archive-players.php lists them all at an address such as www.site.com/players. I'm then using a url like www.site.com/players?type=pro to list another page ...
1
vote
1answer
47 views

Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?

I am using custom urls for my author pages like this: http://site.com/author_name After I create a new user, that author page appears as not found; however, if I update my permalink structure from ...
1
vote
1answer
299 views

Multiple Permalinks for Same Post

I'd like to be able to have multiple permalinks for the same underlying post (for i18n reasons) - eg http://www.example.com/my-custom-post-type/this-is-a-cool-article ...
1
vote
1answer
273 views

Remove rewrite rules generated by plugin during deactivation‎

I have a simple plugin like the following add_action('generate_rewrite_rules', function ($wp_rewrite) { $wp_rewrite->rules = xxx + $wp_rewrite->rules; }); if (is_admin()) { ...
1
vote
1answer
3k views

How to Rewrite Wordpress URL for a Plugin

I am trying to build a Wordpress plugin here with a custom user admin area. What I would like to do is when the user adds /edit at the end of the page, it should open a page from my plugin. So for ...
1
vote
1answer
294 views

How does WP handle multiple matching rewrite rules?

Here is my url to a custom type : http://host/movie/my-slug When I go to this link, I'm redirected to http://host/movie/my-slug/?post_type=movie which results in a 404 error. I use Rewrite ...
1
vote
1answer
481 views

Force a specific template based on the URL

When a user browses to a URI beginning with "/forums", WordPress should call a specified template. For example, all of these URLs: mysite.com/forums mysite.com/forums/questions ...
1
vote
1answer
445 views

remove_query_arg() on rewrite rule

I'm attempting to add a Back to Search Results link which in essence will simply link back to the starting search page - for example /?s=test. I've taken a look at the global query vars and do see ...
1
vote
1answer
102 views

custom template rewrite

I have a page called my-todo-list and is using a custom page template. The page is accessible via this type of URL : http://domain.com/my-todo-list/ Now I need to paginate it, and I want to look ...
1
vote
2answers
867 views

Where do I USE add_rewrite_rule?

I need to add a RewriteRule to my site. I have tried in .htaccess with no luck, it doesn't get parsed, so I'm all but giving up on that. I found the documentation on add_rewrite_rule, but have no ...
1
vote
1answer
84 views

generate_rewrite_rules (action) vs add_rewrite_rule (function): which one is preferred?

I see these two methods can be used to create new custom rewrite rule, so under what situation which one is preferred? I suppose they are doing the same thing? I can either use: add_action( ...
1
vote
1answer
55 views

Performance impact of rewriting WordPress URLs

I'm currently rewriting author URLs in WordPress. I've removed the author base slug /author/. Please note I have total control over page slugs so can guarantee there will be no conflicts. I've added ...
1
vote
1answer
85 views

Custom rewrite_rules - only pass numbers and not alphabetic characters

I'm trying to add a rewrite rule to pass a var to a custom page template. For some weird reason it only excepts numbers in the variables, when I type in characters other then number it directs to ...
1
vote
1answer
79 views

Using WP Rewrite, but just not “getting it”

I'm trying to use WP Rewrite to avoid having to enter anything into an htaccess file. So far, I have this one working just fine (it loads a post from a Custom Post Type): $leader_structure = ...
1
vote
1answer
138 views

add_feed and flush_rewrite_rules

There seems to be quite a controversial opinion on the WordPress flush_rewrite_rules() function. According to the Codex, it is highly discouraged to use this function on the init action hook. ...
1
vote
1answer
208 views

How to set up Author archives with sub category URL

So i have a site where i have used the authors.php page so that i can display individual user's profile pages.. the url then looks something like: http://mydomain.com/author/test/ What i would like ...
1
vote
3answers
475 views

Flush Rewrite Rules when new site is created on network

I am working with a multisite setup and I have created some custom post types, which seem to work fine except when trying to view any of the post types pages on the front end, I get a white screen. ...
1
vote
1answer
511 views

Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?

I've added a myvar/myvalue rewrite endpoint to EP_ALL which can be added to any URL of a WP installation and a WP plugin will act upon it. That part is cool but it doesn't work when the permalink ...
1
vote
1answer
324 views

Adding paged query to custom URL rewrite

I have set up the following to create 'pretty' post type and category permalinks: function kdev_add_category_rules() { $post_types = array( 'kdev_photos', 'kdev_videos', ...
1
vote
3answers
456 views

Wordpress Rewrites - How can I pass a variable to Custom Post Type?

I'm looking for a wordpress rewrite that will let me pass a query var. I have a custom post type that produces urls like this: example.com/custom-post-slug/custom-post-title/ my goal is to have ...
1
vote
1answer
122 views

Monkey Man Rewrite Analyzer says my rule will trigger but it doesn't [closed]

I installed Monkey Man Rewrite Analyzer, i got a rule installed, it shows in the list, if i test it with monkey man it says it will fire but it doesn't in reality, whats wrong? add_action('init', ...
1
vote
2answers
318 views

External Rewrite Rules

I'm trying to add a rewrite rule to Wordpress. I want to rewrite: "http://www.domain.com/plm_check/var_a/var_b/var_c/" to actually use a file from ...
1
vote
1answer
316 views

ReWriteRules and WordPress Multi-Sites with Sub Directories

I'm having a diffucult time getting the ReWriteRules and URL structures setup for a Wordpress 3.4.2 (latest version as of this post) blog with multi-site enabled. www.ourdomain.com/ is the homepage ...
1
vote
1answer
212 views

Re-write specific custom post type category URL to go to another page

I know this general question has been asked before (like here and here), but the problem is with my limited experience, I cannot get the results I need looking at other people's code. So here's my ...
1
vote
1answer
716 views

Disable wordpress pagination URL rewrite for specific page

I'm hoping somebody could help me out with the following issue. I have a wordpress page: http://www.howdesign.com/design-jobs and there is a list of jobs coming from behance.net via JavaScript. When ...
1
vote
1answer
263 views

Need to add rewrite rule that adds in additional information about the post to url

A have a post type for venues which have the attributes title, state, and suburb. Currently using the default WordPress permalinks I get the following format: mysite.com/venue/{title} However, I ...
1
vote
1answer
381 views

Rewrite rule for a query string

I have a taxonomy search form and the link output is http://localhost/wp/?cityid=16 But i want it to be rewrited as http://localhost/wp/cityid/16 .htaccess # BEGIN WordPress <IfModule ...
1
vote
1answer
467 views

All pages after level 1 showing 404 after WordPress migration plugin - how to fix?

I am in the process of moving my blog away from GoDaddy (yey!) to HostGator. I used the migration plugin on GoDaddy tat created the gz archive of the database, and I copied all my files over to the ...
1
vote
1answer
182 views

Rewrite ugly URL to clean URL

Im trying to go from: http://www.example.com/product?level1=value1&level2=value2&level3=value3&level4=value4 To: http://www.example.com/product/value1/value2/value3/value4 Sometimes ...
1
vote
1answer
249 views

How To Consistently Enforce Rewrite Rule in Plugin Development

Let's say I create a customer support plugin that hijacks the /support part of the URL and redirects it to an MVC framework in my app folder of my plugin folder, like so: RewriteRule ^support(.*)$ ...
1
vote
1answer
1k views

Auto generate rewrite rules for multiple taxonomies

so i'm back with rewrites... i am looking for a more automated solution. i stumbled across this on the interwebs: /** * Generates all the rewrite rules for a given post type. * * The rewrite ...
1
vote
1answer
1k views

Rewrite wp-login.php URLS to static pages?

I'm struggling with getting a few things in WP to redirect. I'm using a front-end profile / profile editor, and I'm also using a front-end login/register. Naturally I would like to redirect the ...
1
vote
3answers
522 views

Making extra parameters optional

I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit: add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', ...
1
vote
2answers
296 views

Custom URL rewrites work, but break my permalinks

I'm doing custom URL rewrites according to this method , which work beautifully. But as a result my regular post permalinks are broken. So, I'm rewriting "/pagename/1232432" into ...
1
vote
3answers
3k views

TimThumb & htaccess : clean url

Do you know if there's a way to alter via htaccess the timthumb urls ? My question is if i can change for example urls like this ...
1
vote
2answers
189 views

Help With Rewrite_Rules For a Custom Plug-In

I've been reading through this question and answer with great interest as I'm trying to achieve something very similar, but I'm failing and was wondering if someone could help me out. I am also using ...
1
vote
0answers
19 views

Pretty permalinks IIS gives 404 on posts/pages

I'm trying to get Wordpress to work under IIS and I've gotten stuck on custom permalinks. If I use the standard ugly permalinks, All standard features works fine, but plugins like Buddypress does ...
1
vote
1answer
9 views

Best action to call add_rewrite_rule

In Codex I found that the best action to call add_rewrite_rule is the init action. So in this way the function is called every time the site load. But to save the rule in rewrite_rules option it would ...
1
vote
1answer
16 views

Custom post type permalink returns 404

Mates, I've created a custom post type. Created some posts of that type, but when I try to access to any of them, I get 404 error. Also created single theme (single-pb_progproy.php). Here's the ...
1
vote
0answers
62 views

Rewrite rule for path of favicon.ico ( Add_rewrite_rule function possible ? )

Hi Wordpress developers ! I'm wondering, is it possible to make by PHP and power of Wordpress following: If user access http://localhost/favicon.ico, is it possible to make show user data from ...
1
vote
0answers
210 views

remove base slug from hierarchical custom post type

I've tried various methods posted here and on stackoverflow and none of them work unfortunately. My CPT is "service_locations" and by default has this structure for main pages: ...
1
vote
0answers
87 views

How to Combine Two Custom Post Types into Single Permalink Structure

The website uses - A) A hierarcical Custom Post Type "Destination" to support the following structure, so each tier of the hierarchy could have its own unique destination guide: Territory - ...
1
vote
0answers
90 views

Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)

I have a custom post type named "tours" and a custom taxonomy named "tour_type". "tour-type" taxonomy is hierarchical. In "tour-type" taxonomy, parent terms are limited to "eco-tours", "daily-tours", ...
1
vote
1answer
1k views

Custom query_vars and parse_request on wp-admin

I've read this post http://wordpress.org/support/topic/query-vars-in-admin and although it's quite an old question, it suits me perfectly. I'm trying to accomplish what I already posted here: ...
1
vote
1answer
51 views

Rewrite Rules returning wrong data

I have a custom post type called product. It is categorized with the two taxonomies product_category (which is superior) and product_group. I want the permalinks for single products to appear like: ...
1
vote
0answers
302 views

Multisite sub-directories IIS 7.5 change media/uploads location

I am running WP 3.8.1 Multisite. Sub-directories is configured. I have 10 sub-directory sites and 1 primary site. WordPress is running on a Windows 2008 R2 datacenter 64bit server with IIS 7.5. I have ...
1
vote
1answer
36 views

How to always rewrite author archive page URL even if the author does not have a post

My understanding about author archive page URL rewriting is that as long as the author has atleast one post/page the URL for the archive page ofthe author will be re-written to: ...
1
vote
1answer
104 views

Is a permastruct possible on pages?

Since a couple of weeks I'm trying to create my own rewritings on pages. I read a lot about rewriting with posts and custom post-types. BUT: I have pages that I call with variables. How is it ...
1
vote
1answer
66 views

Make custom post types and pages place nice, re: rewrite

I have a page structure like such: Executive Events Annual Conferences Webinars I also have a custom post type named 'event'. I have set up the post type so that I get exactly the permalink ...
1
vote
0answers
29 views

Custom Permalinks for Custom Taxonomies/Post Types -> Top Level Pages not working [duplicate]

I have created a custom post type called "artists". These are categorized by the custom taxonomy "style". I do have this: ./photography/edward-example (single page with details) ...