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

0
votes
0answers
34 views

Rewrite URL based on form input

I have a form: <form action="<?php echo get_permalink(); ?>" method="get"> <select name="genres[]"> <option value="jazz"></option> <option ...
0
votes
0answers
110 views

How to make a custom route with any-string-part/number-part pointing to an existing page?

I've got a page with my own widget inside of it which needs some params from the url to produce dynamic db results - don't worry everything is sanitized well and I only let this part out to keep this ...
0
votes
0answers
348 views

add_rewrite_rule not working

I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here: add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?foo=bar','top'); The wiki page says: ...
0
votes
0answers
23 views

Custom Post Type rewrite with Custom Taxonomy and Custom Meta!

I have a custom post type called 'photos'. I have a custom taxonomy called 'series'. Each post will have a custom meta item called '_photo_number'. I want my URLs to go something like this: Single ...
0
votes
1answer
138 views

Rewrite Rule & Regex - Extract 'cat-name' and 'page-number' from http://domain.com/custom-post-type/category/cat-name/page/page-number

I have an URL formatted so: http://domain.com/custom-post-type/category/cat-name/page/page-number I need to extract: cat-name and page-number So that in my functions.php, I can create the custom ...
0
votes
0answers
135 views

Only homepage working correctly, 404 error on everything else

I've been developing wordpress based websites for some time now, and i built one for my company's own brand, it worked with no problem at all for ages, but now for some reason, i can only get the ...
0
votes
1answer
54 views

How to create custom content on custom page from plugin?

I have a plugin that I'm working on and I'd like the plugin to create and display custom content on a "page" created using a rewrite rule. I've successfully created the rewrite rule with ...
0
votes
0answers
68 views

rewrite rule for home/index page

I've been struggling for a while already and all of my attempts failed so I have no other choice but to ask for help here... a) I've made a custom post type page_blox whose capability_type => ...
0
votes
0answers
41 views

Rewirte the theme URLs

I was trying to implement the rewrite system of Roots on my theme. I followed this tutorial. In my functions.php I put the following: include_once(THEME_LIB . '/rewrites.php'); And created the ...
0
votes
0answers
167 views

Set $wp_rewrite->non_wp_rules inside a plugin

I am attempting to set non-wordpress rewrites inside of a plugin. My $wp_rewrite->rules are getting set properly, but the $wp_rewrite->non_wp_rules are not getting set at all when I ...
0
votes
1answer
123 views

Rewrite url / permalink for default archive - yearly / monthly

I want to change the structure of yearly/monthly archive URL of default post type 'post'. As we know be default the URLs are like: Default: http://wwww.domain.com/2013/09 but want them rewritten, ...
0
votes
0answers
26 views

Post Type Rewrite Custom

Demo for example: my-site.com/shop-virtual/ - Listing all posts of Post type "Products". my-site.com/shop-virtual/products/category - Listing all posts of Category. ...
0
votes
1answer
110 views

How to use WP_rewrite?

I need to add the following rewrite commend to WordPress .htaccess file: RewriteRule ^read/([0-9]+)/?$ /read/?u=$1 [QSA,L] How to do this by a function? i.e., how to do it by use wp_rewrite in ...
0
votes
0answers
16 views

Rewrite author_name to color [duplicate]

I'd like to rewrite author_name to color. So example.com/?author_name=blue would be example.com/?color=blue I searched for hours but can't find anything useful. Any ideas?
0
votes
0answers
60 views

Rewrite author_name

I need to rewrite author_name to cat. I searched for hours but can't find anything. I restrict the search results by author instead category because of the performance, it's much faster. For getting ...
0
votes
0answers
109 views

Select good template with rewriting rules

After creating the sub page "China" of the parent page "Destinations", I add to it the "Destinations countries" template. Without any redirection, I can display the correct template at this url : ...
0
votes
0answers
551 views

Adding rewrite rules to Custom Post-type mixed with Taxonomy

I turn to you because I can not find any solution to my problem. I created 3 custom post types "Actualités", "Dossiers", "Vidéos" (I'm french :D) I created 1 taxonomy: "Thématiques" with the ...
0
votes
0answers
43 views

Custom site-wide url redirect

What would be the best way to go about this situation: I have a site that I want to allow other people to link to, but then keep their links maintained across the entire site. So say, if I was a ...
0
votes
1answer
82 views

What is the proper way implement a global $wp_rewrite?

The below code works correctly, but I don't know if it is proper coding. Can anyone confirm or comment on the code? add_action('init', 'news_rewrite'); function news_rewrite() { global ...
0
votes
1answer
60 views

rewrite rules add a folder in the path

I have to do some url rewritting for custom post types. I have 2 custom post types: portfolios and locations. What I need to change is the url like this: current: ...
0
votes
0answers
51 views

Custom Rewrite for Profiles

I'm currently trying to modify my rewrites to allow for an additional URL segment e.g. http://example.com/vendors/username/ by default WP allows for additional numeric segments but everything else ...
0
votes
1answer
51 views

Wordpress Custom Rewrite Rule

I have a custom page template to use for a wordpress page. I am trying to setup a custom rewrite rule but without success. I have a page at blog/book-page/, the display of this page depends on the ...
0
votes
0answers
62 views

htaccess problem not being able to overwrite previous rules

so guys, what i need to do is: whenever someone ask for this url: dev.site.com/noticias/id/tittle-for-the-news ( dev.site.com/noticias/([0-9]+)/([A-Za-z0-9-]+)/ ) it needs to get this: ...
0
votes
1answer
51 views

Rewriting WordPress URLs

I've got a plugin which takes input through a GET request via a shortcode. The shortcode is placed on a page with the address /search, and the query used to execute this particular piece of the search ...
0
votes
1answer
387 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
165 views

Per Page Permalink Structure for Page Post Type

I am trying to Re-Write Page URL's so that they END with .htm I was able to do this using... /* Add .htm extension to Page URL Links */ add_action('init', 'htm_page_permalink', -1); function ...
0
votes
0answers
194 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
82 views

standard post with extra parameter brings permalink problem

This problem concerns several rewrite rules, but i'll stick to one, for clarity. In my theme, i use a parameter "parentid" which gives me the page/post/custom post i've clicked on (the parent). in ...
0
votes
1answer
56 views

Custom Rewrite Problem

I'm creating some custom rewrites using the code below. Everything works fine, as far as urls such as this: example.com/reviews/showname Tells my theme to use the special archive page and passes ...
0
votes
1answer
151 views

Rewrite and replace url wp-admin/edit.php and wp-admin/post-new.php

everybody I want to rewrite and replace all url mydomain.com/wp-admin/edit.php -> mydomain.com/wp-admin/edit/ and mydomain.com/wp-admin/post-new.php -> mydomain.com/wp-admin/addnewpost/ How i ...
0
votes
2answers
136 views

Paginate yearly archives for a custom post type

Here's the code I'm using to create yearly archives for a custom post type: function myquery_custom_post_rewrite( $rewrite_rules ) { $myqueryslug = 'customposttype'; $month_archive = array( ...
0
votes
2answers
127 views

Redirect taxonomy to custom template to list terms in taxonomy

I'm trying to adapt some code on calling a custom template via rewrite rule. I have a custom taxonomy called "state". I want to create an archive for the taxonomy, that lists all the terms in that ...
0
votes
2answers
93 views

Custom rewrites for pages and categories

I am trying to understand how can create custom rewrites for pages/categories. Ex i have example.com/?page_id=178 and for this page have a contact form and i want this: %slug%.php ...
0
votes
2answers
288 views

Custom post type paging 404 error

I've an issue on custom post type, I've create a custom post type called "Agenda" and the rewrite url for http://example.com/agenda it works correctly, it points to the archive-agenda.php template ...
0
votes
1answer
59 views

Rewrite rule help for gallery plugin

I am writing a basic gallery plugin for WordPress. In the plugin users can mark images as favorites and there is a page where users can see their favorites. I want to setup some rewrite rules for the ...
0
votes
1answer
83 views

Rewrite URL variable to custom path

I am passing to my url some variables to display latest posts, most viewed etc. http://website.com/?r_sortby=highest_rated I am wondering how to create a custom path for it instead for SEO purpose ...
0
votes
1answer
133 views

Append custom parameter to taxonomy/term URI

I have a Custom Post Type named "Cars" and 2 Custom Taxonomies "Ferrari" and "Lamborghini". Each taxonomy has 2 Terms: "New" and "Used". These URIs work as expected: http://myhost/ferrari/new ...
0
votes
1answer
115 views

How to Add Rewrite Ruled Argument Into Permalink Properly

I am using WP rewrite rules for my custem arguments, But when I am trying to generate permalink like this: add_query_arg(array( 'type' => 'foo', 'paged' => 2, ),get_permalink($id)) ; ...
0
votes
1answer
48 views

Ideal top-level slug methods

Right now I have a post type that generates a slug, e.g. http://url.com/l/abcd/ for each entry. I have a query in my 404.php that checks for http://url.com/abcd before output and redirects it if found ...
0
votes
2answers
123 views

Rewrite function

I have a wordpress blog. I get url in blog like this, http://www.domain.com/2013/01/test19/page/2/ But I want my ur like this, http://www.domain.com/page/2/ So can we rewrite this url. I ...
0
votes
1answer
127 views

Virtual Page with Registration form

Working on a plugin, which is intended to provide a registration on front-end, to let users register. I am trying to create a Virtual page, which would display the form. Trying to create URL like ...
0
votes
1answer
415 views

Custom url structure - pages under a custom post type

I'm struggling with the structure of my Wordpress site and I was hoping you might be able to give me some advice. The site is for a series of events and the structure is as follows: Gateway ...
0
votes
1answer
167 views

Custom post rewrite rule not working

I'm adding a custom post type like so (names have been altered to protect the innocent): add_action('init', 'my_post_types'); function my_post_types() { register_post_type('publication', ...
0
votes
1answer
108 views

Rename page URL

I have the following URL structure: http://localhost/wordpress/gallery?id=331 id specifies the id of the post. gallery is a normal page inside which I am accessing the id of the post and fetching ...
0
votes
1answer
116 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
64 views

Custom Taxonomy in Permalink from post type

I am using custom post types and custom taxonomies for that post type. This snippet currently sets the permalinks for the post type: 'rewrite' => array('slug' => 'myrewritebase'), I am ...
0
votes
1answer
272 views

rewrite rules hierarchical

I want that my WordPress follow this rules: /productes/ a page with all products /productes/[category]/ a taxonomy-page with all products of the category /productes/[category]/[subcategory]/ a ...
0
votes
1answer
79 views

Wordpress Rewrite Rules

I created the page template which needs to take some GET variables, currently URL's looks like that: http://example.com/coupons/?cat_id=25 I need to make that way: http://example.com/coupons/25 I ...
0
votes
1answer
888 views

i want to rewrite my custom plugin url

I am Working on wordpress plugin. and i have a form like this $action_url = WP_PLUGIN_URL .'/demo-url-rewrite/include/test.php'; <form action="<?php echo $action_url; ?>" ...
0
votes
1answer
328 views

Custom Post Type Rewrite To Include Parent Page(s)

I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide". My permalink structure is ...