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

1
vote
0answers
80 views

How make a multi language routes, with rewrite rules or rewrite endpoints?

I want to know a concept of making a multi language routing system for WP. That is the best practice, to make this routing system with add_rewrite_rules for pages post arhive etc in part, or to use ...
1
vote
0answers
125 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
177 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
700 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 ...
1
vote
0answers
225 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
1k 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
139 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
213 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
60 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
109 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
183 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
158 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
49 views

Add custom parameter to permalinks

I have a WordPress page that I would like to use SEO friendly query parameters with. Let's say this wordpress page is accessible by going to http://www.example.com/test and its short URL is ...
0
votes
0answers
14 views

Can I use the same permalink base for Categories and Posts?

I am migrating our site from another CMS and the way the permalinks were setup with the prevous CMS are like this: posts: /news/%year%/%monthnum%/%day%/%postname%/ categories: ...
0
votes
0answers
22 views

Stop WordPress from redirecting ?p= in custom rewrite rule to slug of page

I've written a custom rewrite rule, which should rewrite a specific case of a taxonomy url to serve a page. The rule is as follows: add_rewrite_tag('%tax_slug%', '([^&]+)'); ...
0
votes
0answers
16 views

Rewrite URL of a page which is child of a Custom Post Type

With the plugin Types I've created a hierarchical custom post type "journeys", and then I set that normal "pages" are child of "journeys". I've created a "journeys" post called "My First Journey". ...
0
votes
0answers
7 views

WordPress Rewrite/Query Var .. ignore a word?

I have created an 'event listing' area on my WP website, it uses rewriting and a query var to dynamically load the event 'slug' as a variable so that I can add pages on the fly. However it has broken ...
0
votes
0answers
28 views

Widgets: Ajax Filtering and Add rewrite rules

I have built an Ajax filtering plugin for my widgets that works by adding url params through jQuery (when a link is clicked) and having pre_get_posts $_GET these values. These values then setup the ...
0
votes
0answers
30 views

add_rewrite_rule not working on WordPress site

For my WordPress site I am trying to make two URLs display the same content, without redirecting to the other page. So, for example I want to make: ".../books/ilium" display the same content as ...
0
votes
0answers
20 views

using two different urls for same post

I want to use two different permalinks for same post for some reasons the permalink structure i need are http://www.example.com/category-name/post-name http://www.example.com/post-name please help ...
0
votes
0answers
21 views

add_rewrite_rule working for posts but not for pagination

I have used add_rewrite_rule to change my urls please check the code below. add_rewrite_rule( '(.+?)/([^/]+)/?$', 'index.php?category_name=$matches[1]&name=$matches[2]&is_play=1', ...
0
votes
0answers
19 views

I am trying to add a mode rewerite rule that seems to fail

I am trying to redirect everything from /app/.... to a certain page Will use that later for angular js. This is what i came up with : add_rewrite_rule('/app/.*', 'index.php?page_id=11', 'top'); ...
0
votes
0answers
28 views

WordPress render's 404 for known rewrite rule

I have defined rewrite rule for my hieratical custom post type. remove_filter('template_redirect', 'redirect_canonical'); function add_artists_query_vars($aVars) { $aVars[] = "work_index"; ...
0
votes
0answers
20 views

Intermittent Rewrite Problems

I have a few custom rewrites on a site I have developed. I'm having a couple of issues: The rewrites don't work properly without using "flush_rewrite_rules(true)" directly following their setup. It ...
0
votes
0answers
16 views

WP Rewrite - some rewrite rules are ignored and instead a redirect is served

I am trying to allow any URI that's prefixed with pf/ to show a page without redirection. I do this by filtering rewrite_rules_array and simply duplicating the rules with a pf/ prefix public function ...
0
votes
0answers
26 views

Wordpress add_rewrite_rule with priority

I'm working on a Wordpress website which shows companies in a city. The URL's are like www.address.com/new-york/. I've created a rewrite rule for this and it works but now i'm not able to visit any ...
0
votes
0answers
83 views

Using add_rewrite_rule() to redirect to Front Page

I'm using a static page for my Front page. It is a custom template. On my custom template I am using WP_Query() to show a list of posts. I also have a custom taxonomy called "Types" that I use on my ...
0
votes
0answers
20 views

Custom rewrite rule returns post instead of (start)page

I need a custom rewrite rule so that /a/b/c/d/123 points to the startpage because my own plugin on the startpage needs those parameters from the URL. / I was able to accomplish most of ...
0
votes
0answers
42 views

Trying to add $_POST Array to update_post_meta doesn't populate

This is the code that is sending the info: $postdata = array( 'show_id' => '11', 'show_start' => '2015-03-17 11:00am', 'line_items' => array( '1' => array( ...
0
votes
0answers
24 views

How to prefix all rewrite rules in wordpress?

I want to prefix all permalinks in wordpress, and get this value from query_args. For example http://wp.dev/sample-page transform in http://wp.dev/en/sample-page. I want for all permalink, for page ...
0
votes
0answers
63 views

RewriteRule directive not working without [P] flag

I need to rewrite some URL's, but I ran into strange problem. For some reason RewriteRule directive only works if I use proxy flag, for example: RewriteRule ^foo$ /www_dev/test/page2-2/ [P] works as ...
0
votes
0answers
48 views

Adding custom post types and add custom add_rewrite_rules

I am adding custom post types using the class created by https://github.com/jjgrainger/wp-custom-post-type-class I am then adding classes using this to add rewrites: /** * Class to init our mvc * ...
0
votes
0answers
36 views

add_rewrite Rule

I want to add a rewrite rule, the remove the "base" from a custom taxonomy link. There current structure is: http://example.com/bundesland/TERMSLUG I would like to have it like this: ...
0
votes
0answers
27 views

Rewrite Rule Regex

I've added rewrite rule: add_rewrite_rule( 'slider-settings/(\w*)$', 'index.php?pagename=slider-settings&slider_id=$matches[1]', 'top' ); This url ...
0
votes
0answers
51 views

Custom rewrite rules without a sub folder path to identify clash with pages

I need to be able to have routes to links that are both pages and products from the main wordpress root directory, without anything to distinguish between what a product (which is a template_redirect) ...
0
votes
0answers
51 views

Custom post type url removal for child posts

Hello so my issues is that i cannot figure out how to remove the post type name from the permalink of child post. Already went though most of the solutions on the web but not none helped. Basically ...
0
votes
0answers
54 views

PHP Rewrite Wordpress Folder to act as query string variable throughout site

I'm hoping in this is a possibility with Wordpress and I have been researching this for hours online and I'm not find a definitive or simple working example of how to achieve my goal. I need ...
0
votes
0answers
40 views

Remove final slash from url

I created rewrite this rule: public function manage_user_routes() { add_rewrite_rule( '^user/([^/]+)?', 'index.php?control_action=$matches[1]', 'top' ); } but when I try to access ...
0
votes
0answers
99 views

add_rewrite_rule set up correctly, why does new URL show 404?

My aim is to have the following URL structure: /text-string/text-string/directory/text-string/text-string/1234/ point to page 447 with parts of the URL passed as get variables. (I am not worrying ...
0
votes
0answers
230 views

Custom Page Template add_rewrite_rule

I have a custom page in my child theme. I add these code to function.php in my parent theme. In that custom page I have manga reader script. My Custom Page's URL; mangayurdu.com/myy/ ...
0
votes
0answers
40 views

How write rewrite rule to reroute tiny url?

I want to know how to write a regex : for exemple url: http://localhost/wordpress/post-title/lang/en become http://localhost/wordpress/post-title/en. I need a global rule for all types of posts? ...
0
votes
0answers
107 views

register_post_type, add_meta_box, add_rewrite_rule

I'm working on custom post type with some custom fields setup using add_meta_box. register_post_type("sample"); add_meta_box("sample_type"); add_meta_box("sample_brand"); I want to get it working ...
0
votes
0answers
29 views

Prevent guessing slug

I have the following rewrite rule function add_rewrite_rules($rules) { $new_rules = array( 'buscador-latte/(.*)/?$' => 'index.php?page_id=866&search_parameters=$matches[1]', ); ...
0
votes
0answers
18 views

Rewrite Rule To Own File

Is it possible to add a rewrite rule to redirect to a page other than index.php? For example: add_rewrite_rule('([^/]*)/preview/?','preview.php?page_title=$matches[1]','top'); The above code only ...
0
votes
0answers
28 views

Wordpress internally rewrite rule challenge

Questions 1: I work on wordpress website for a client. But the client like to have a deep level url structure. The custom post type can be from level 1 to unlimited levels in the url structure. ...
0
votes
0answers
86 views

htaccess url rewrite within WP installation

I want to use one of my subdomains to rewrite urls and finally forward to an origin extern domain. Example: goto.mydomain.com/1saKCA3 -> externdomain.com/1saKCA3 I already tried to implement the ...
0
votes
0answers
46 views

Remove add_rewrite_rule from the init hook

I have some pretty complex way to calculate a rewrite rule. Normally I add them like this function my_rewrite_rules(){ //fancy stuff to calculate the $rewriteurl which takes some time to ...
0
votes
0answers
30 views

I want to add one extra field to my URLs, I'm using Rewrite functions but it doesn't work

I think my question isn't in the right way, I just ask it. I want this routings for my wordpress site (for example in Custom PostType Archive page): example.com/VALUE => ...
0
votes
0answers
111 views

Remove Rewrite Rule

after adding a rule: add_action( 'init', 'wpse26388_rewrites_init' ); function wpse26388_rewrites_init(){ add_rewrite_rule( 'usuario/([0-9]+)/?$', ...
0
votes
0answers
73 views

Set a Category As My Homepage using add_rewrite_rule

When someone visits the homepage of my wordpress site: http://www.mysite.com/wordpress/ I want them to see the contents of this page: http://www.mysite.com/wordpress/category/cars/ Attempt # 1: ...