add_rewrite_rule() allows you to specify additional rewrite rules for WordPress. It is most commonly used in conjunction with add_rewrite_tag() (which allows WordPress to recognize custom post/get variables).

learn more… | top users | synonyms

0
votes
2answers
100 views

URL Rewrite doesn't work for nested pages

I am using URL rewrite like this page: unexpected problem in url rewrite It works without any problem, but when I try to use the same rules for nested page, it doesn't work. Say, I have two pages ...
0
votes
2answers
237 views

add_rewrite_rule to remove /category/ from permalink

Hi I have many permalinks across my site that looks like this: http://www.mysite.com.com/market/category/slug/slug/slug/ http://www.mysite.com.com/market/category/slug/slug/ and would like to hide ...
0
votes
2answers
207 views

404 Error On Custom Taxonomy Pages 2, 3, etc

I've been reading a bunch of posts about this with no luck so far. I can't seem to figure out what is the problem. I have the following: Custom Post Type: Sermons Custom Taxonomy: Series My urls ...
2
votes
1answer
92 views

Pagination problem

I have two custom rewrite rules: add_rewrite_rule('foo/bar/?', 'index.php?post_type=foo', 'top'); add_rewrite_rule('foo/bar/([a-z]+)/?', 'index.php?post_type=foo&bar=$matches[1]', 'top'); Which ...
2
votes
1answer
608 views

add_query_vars and add_rewrite_rules

I am looking for some clarity on what add_rewrite_rules does. If I type in, or submit variables from a form, is it supposed to change the query variables to the pretty url? Currently when I type in ...
1
vote
1answer
69 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
43 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
124 views

Custom Rewrite Rules

I am developing a plugin, the goal of which is to allow for a bookmark-able, pretty permalink search engine on a single page. To do so, I am using WP's rewrite rules to allow for the ...
1
vote
1answer
218 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
276 views

query_vars in plugin not working?

I have a problem writing a plugin for wordpress. First, I register a new query_var and add a new rewrite rule: function nng_users_query_vars( $vars ) { array_push( $vars, 'nng_users' ); ...
1
vote
1answer
89 views

Different rewrite rules for taxonomies and cp in multisite?

I´m making a multilingual site with multisite and I`m wondering if you can specify different rewrite rules for taxonomies and custom posts for the different sites, that are using the same theme. Maybe ...
0
votes
1answer
44 views

Getting add_rewrite_rule and add_rewrite_tag to work

I am new to using add_rewrite_rule and add_rewrite_tag. I am trying to get a very basic example to work, but nothing I do seems to make it work. I want to access this URL (this works when entering ...
0
votes
1answer
37 views

add_rewrite_rule not working for me

I have the following rewrite tags defined: // ADD REWRITE TAG FOR 'VEHICLE MAKES' add_rewrite_tag('%make%','([^&]+)'); // ADD REWRITE TAG FOR 'BODY STYLES' ...
0
votes
1answer
23 views

Wordpress monthly archive links result in 404

When I use the archive widget in a sidebar, it creates the normal monthly post archive listing like the following: February 2014 January 2014 October 2013 and so on. Whenever I click on these ...
0
votes
1answer
74 views

Wordpress URL rewrite problem

blog.com/product/somename In the above URL - how do I tell Wordpress that 'product' is a variable and 'somename' is its value. Then how do I extract that value and use it inside a function I'll ...
0
votes
1answer
69 views

Wordpress permalink still not working (error or not understood?)

After hours in understanding wordpress permalinks I'm despairing and hope that somebody can help. I have the following link: www.mysite.com/?page_id=923&bahn=BER After activating the ...
0
votes
1answer
45 views

how to exclude admin page from add_rewrite_rule in wordpress

I'm trying to add the following rewrite rules: add_rewrite_rule('([A-Za-z0-9])/([A-Za-z0-9])', 'index.php/product?subcategory=$1&product=$2', 'top'); add_rewrite_rule('([A-Za-z0-9])', ...
0
votes
1answer
52 views

Add custom content to nonexistent page

I am trying to add content to what would otherwise be a 404 page. For example I want to define post content for mysite.com/existing-page/imaginary-page instead of showing the 404 page. I've tried ...
0
votes
1answer
56 views

Why is a rewrite rule in wordpress prevent pagination?

I have a custom page that uses a rewrite rule. The "non-pagination" rewrite works fine: add_rewrite_rule( '^brand-list/([^/]*)/([^/]*)/?', ...
0
votes
1answer
317 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 ...
0
votes
1answer
109 views

Rewrite rule to redirect to a particular filename.php

I'm using the Monkeyman Rewrite Analyzer plugin (http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/) I want to write a rule that will be take a URL (that is specified in the user's accnt ...
0
votes
1answer
76 views

Wordpress post-type create url rewriting

i create a new post-type in wordpress. The new post-type is called work. I want to customize the link when the user click "details button". The link is work/post_id/postname I have a trouble to ...
-1
votes
1answer
313 views

How to redirect image attachment to its original post

I'm making a slider that is getting images from attachments in the post. I am trying to rewrite the url for the post so that if someone pastes the direct url to the attachment, it'll go the post ...
1
vote
0answers
23 views

add_rewrite_endpoint() and Custom Post Type Archive

I've got a custom post type. Let's call it books. I'm adding a new rewrite endpoint called pages. I want the url /books/pages/2/ to work but I don't see any rewrite rules generated by WordPress for ...
1
vote
0answers
62 views

WP Rewrite the last two parts of the URL

I have found quite a lot of post on the subject of WP rewrite but I can't find the right words to describe this problem. I'm trying to accomplish the following: ...
1
vote
0answers
125 views

Get url.com/post_type/taxonomy/term work!

I'm having trouble get what I want by mixing custom post types and taxonomy. I want to run this: www.url.com/post_type/taxonomy/term In my case this: www.url.com/dossier/theme/sante (sante is a term ...
1
vote
0answers
343 views

URL Rewrite and add_query_var not working

I know there are several topics about URL rewriting in Wordpress but none of the topics I found helped me. I want to rewrite the URL profile/?person=abc (which works fine, but isn't pretty) to ...
1
vote
0answers
100 views

How to pass url as a parameter in a add_rewrite_rule

I am building a plugin which relies on passing the url as a GET parameter. Now, I am trying to prettify the links by using rewrite rules but am stuck. What I have now: function ...
1
vote
0answers
132 views

Rewriting single post url; add_rewrite_rule problem?

I have to customize single post permalink (the structure of the permalink) if posts have a certain value in a certain custom fields. I use the filter post_link to change permalink when needed, and ...
1
vote
0answers
49 views

Customise particular RSS permalink

From my old static website, I want to preserve some URLs like the RSS Feed one. My feed URL is http://traduction.bainslesbains.com/actualite-russe.xml and I want to redirect it to the category feed ...
1
vote
0answers
97 views

What add_rewrite_tag()'s RegEx matches against?

I'm trying to figure out wether I can specify the position of the string to match (i.e. immediately after the domain) to reduce the chances of matching something else, but I don't even know what the ...
1
vote
0answers
143 views

Struggling with add_rewrite_rule

I've read this: Wordpress redirection to get url friendly That led me to this: 1) wp.tutsplus.com/tutorials/creative-coding/the-rewrite-api-the-basics/ 2) ...
1
vote
0answers
119 views

Evaluating a external rewrite rule before internal wordpress rewrite rule

I am been plucking out my hairs since last few days trying to solve this problem: I want to convert my urls from format http://example.com/prodsearch/category/tag1-tag2-tag3-tag4 to ...
0
votes
0answers
25 views

Custom URL in Wordpress with add_rewrite_rules and add_rewrite_endpoints

I have the following URL for a filter functionality that i try to build in wordpress: example.com/offers-type-all-inclusive-from-germany-transportation-airplane.html How can I make the arguments ...
0
votes
0answers
27 views

add_rewrite_rule query_var not being set

I have an unusual use of add_rewrite_rule (is there a usual use?) and I am getting some unexpected behavior. First here is my code: if(!empty($list_view_template)) add_rewrite_rule( ...
0
votes
0answers
26 views

Custom Rewrite Rule with Sub Folders

I need to create a custom rewrite rule for a WordPress plugin. I have read this topic and came up with a working solution using add_rewrite_rule(). However, after testing the plugin, I realized that ...
0
votes
0answers
17 views

Rewrite rule for custom parameters

Im having rewrite rules like this add_rewrite_tag('%offercode%','([^&]+)'); add_rewrite_tag('%offerdatefrom%','([^&]+)'); add_rewrite_tag('%offerdeparture%','([^&]+)'); ...
0
votes
0answers
101 views

add_rewrite_rule not working in Wordpress Multisite

I need to rewrite urls on a Wordpress Network/Multisite, so I wrote a plugin that does it for me. This plugin works perfectly when using on a Single Wordpress site that does not make use of the ...
0
votes
0answers
72 views

wordpress add_rewrite_rule not working

I have page on my site named annuaire-membres and i want this with my custom search like this example.com/annuaire-membres/character/A or example.com/annuaire-membres/department/xyz for this I ...
0
votes
0answers
33 views

Rewrite rules custom post type

I created a new custom post type "video" and a new taxonomy "singers". There are 3 singers: Michael Jackson, Madonna, Eminem. I'd like change the permalink and so I'd like this URL: ...
0
votes
0answers
29 views

Rewrites with options on custom post type

I have a custom post type called 'episodes'. All of my episodes have an audio file associated with them. This file is embedded automatically in the template. Some of my episodes also have a video ...
0
votes
0answers
208 views

add_rewrite_rule and passing variables for custom post types

this is driving me crazy!! Scenario is... Custom post type let's call it "cpt_product" setup with the rewrite "products" Trying to use the add_rewrite_rule to create a friendly URL for meta details ...
0
votes
0answers
69 views

add_rewrite_rule() for an unknown parent page

I am trying to get this rewrite rule to work right. What I have is a plugin that creates a page after the user inserts a page name in the settings that I created for the plugin. The users custom page ...
0
votes
0answers
135 views

Passing multiple variables in wp_rewrite / wp_query

i need to be able to append a custom url for my page in wordpress so far i can get it to return the first query var, but i cannot get it to return the second or third im at a loss of what to try next, ...
0
votes
0answers
98 views

Conditional add_rewrite_rule

im trying to get 'test' on add_rewrite_rule. I'have a custom post type(product) which is linked to 3 taxonomy (line, gender and type). I would like to have clean url like this ...
0
votes
0answers
71 views

Display results from two Custom Post Types in page template

What I have is Created a new page with slug monuments Created a template file at my theme's folder that will show all records with post_type monument. [UPDATE] 3.I forgot to mention that each ...
0
votes
0answers
170 views

permalink and add_rewrite_rule - error 404

I'd like to have comments in a separate page with a dedicated template only for posts in a specific category (slug shops). Example: mysite.com/post-incatshops --> mysite.com/post-incatshops/comment ...
0
votes
0answers
80 views

Adding in Custom Directory/Path in URL Without Effecting Permalinks

After several tries of piecing together different forms of add_rewrite_rule() and .htaccess edits, I have not been able to find a solution that works. I want to add in a custom directory to a ...
0
votes
0answers
48 views

Permalink of Custom Post Type

I am trying to create a custom post type called an 'event' and have it's permalink structure be as follows: www.domain.com/events/238 where 238 is the post ID. However, when I navigate to the page, ...
-1
votes
0answers
16 views

Classes and Including Files on Init

Switching my plugin over to a class based system so it can be more easily expanded upon. I previously used global functions to set my rewrite rules, and to call them on init. I keep those in a ...