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
228 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 ...
0
votes
0answers
12 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: ...
0
votes
0answers
22 views

WordPress permalinks with Windows Server IIS6 - without ISAPI access

I'm having trouble to export the website to my client hosting . . I get an index.php in the url all the time, I've research about it, change the permalink custom structure to: /%postname%/ and add ...
0
votes
0answers
13 views

how to change some of the rules in the database

I need to add a rewrite rule for a WP page. I noticed that the rule is already part of the existing set, but apparently it is not correct. With the hope some internal mechanism would have replaced ...
0
votes
0answers
25 views

Help with add_rewrite_rule solution

In my Wordpress blog, I configured permalinks > Category base to "magazine" with links having this format: http://www.mydomain.com/magazine/news/europe/france The above link opens the France ...
0
votes
2answers
19 views

Rewrite for page with a possible unknown parent page

I am trying to add a wp rewrite for my plugin that allows users to include a shortcode on a page that will then display a calendar. This calendar then requires url params in order to navigate the ...
1
vote
1answer
236 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 ...
0
votes
2answers
349 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
0answers
15 views

Rewriting URLs with Query Strings

I've been (unsuccessfully) attempting to prettify some URLs in a website I'm building in Wordpress, from something like this - ...
0
votes
1answer
385 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
0answers
18 views

URL rewriting with custom pagination

I'm using a custom query to display the results with the pagination and rewrite the URLs. The following function works fine and displays the URLs in following pattern: ...
0
votes
1answer
33 views

rewrite rules social share links

Within the Ultimatum's theme childtheme.php I've added rewrite rules to the rewrite rules and it works perfectly fine. However, it does not work if the URL is shared in Facebook or Twitter. The ...
0
votes
0answers
19 views

add_rewrite_rule works only with one “directory”

This works (Wordpress redirects to the canonical URL of the post with the given slug): add_rewrite_rule('mydir/([^/]+)/?$', 'index.php?pagename=$matches[1]', 'top'); This is not working (404) ...
1
vote
1answer
330 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: ...
2
votes
1answer
740 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 ...
0
votes
0answers
24 views

How can i add a rewrite rule in wordpress

I want to add following rewrite rule in wordpress .htaccess using add_rewrite_rule() function. RewriteRule ^admin-panel/(.*) wp-admin/$1?%{QUERY_STRING} [L] how can i proceed? Thanks advance.
0
votes
1answer
40 views

Rewrite Rule for Post “Subpage”, with pagination

I would like to know if is possible to add a "subpage" to a post and in this "subpage" have paginated content, for example: I Have a Post Lorem Ipsum This post has Videos, Photos and Audios as ...
0
votes
0answers
28 views

Changing attachment page Permalink

How can i change the attachment page permalinks to http://domain.com/photos/%attachment_id%/%postname%/%attachmentname% currently my permalinks set to Custom Structure ...
0
votes
0answers
18 views

add_rewrite_rule is not fired

I need to rewrite some urls: I have a page (id = 61), with slug anunciantes on wich I use a custom template to generate a wp_query to list a custom post_type. I need to be able to filter by two ...
0
votes
0answers
18 views

Register frontend page without access in backend

I'm looking to register a page that can be accessed from the frontend, while not actually having it show up as a "page" in the admin. I had thought about creating the page programatically and then ...
0
votes
0answers
16 views

images gallery attached to a post as a subfolder of the same post

I would like to know how can I set the Lazyest gallery or other gallery plugin in order to add many pics to a post and the URL's pics to appear as a subfolder of URLs' post? For better understand ...
0
votes
0answers
37 views

How to programatically create a simple HTML page using the permalink of a Wordpress post?

I want a create a simple HTML page (not Wordpress Page) programmatically by using the permalink structure of another already existing post. E.g. Already existing post is ...
1
vote
1answer
29 views

How do I add a add_rewrite_rule without it redirecting?

I have a custom post type called "locations". I have a location called "starbucks". I can view this by going to "/location/starbucks". I would like to add "coffee-shop" to the URL, so the path ...
0
votes
1answer
31 views

Pretty Permalink for Search Queries Not Working

As the title suggests I am trying to create pretty permalinks for search queries, but unfortunately I cant get them to work. I am trying to achieve the folllowing: ...
0
votes
0answers
27 views

URL Rewrite for CPT single posts

I'm struggling with Wordpress' rewrite function I have the following URL structure http://example.com/album/test-7/ 'album' is the slug for the CPT single page 'test-7' is the slug for the CPT ...
0
votes
1answer
35 views

How to add a Rewrite Rule / Category Structure

I'm currently trying to use add_rewrite_rule() to create a rewrite (duh!), for a custom taxonomy page. I've added the rewrite tag "sort" with the following code: ...
0
votes
0answers
26 views

Why is my rewrite rule refreshing the page and removing my variables?

For some reason, the catch-all page rewrite rule is capturing this rewrite, rather than my own rewrite rule. My rewrite rule is listed at the top when doing a var_dump of the rules, as well as when ...
0
votes
2answers
47 views

add_rewrite_rule not registering on Multisite

I have a multisite install of WordPress. I have installed the plugin Monkeyman Rewrite Analyzer so I can see all the rules I have registered. The code below is how I am registering the rule: ...
0
votes
1answer
36 views

Call to a member function add_rule() on a non-object

I want the page mysite.com/product to be accessed with the URL mysite.com/product/productname instead of mysite.com/product?name=productname I am trying to achieve this with the code in the ...
0
votes
0answers
39 views

add_rewrite_rule regex issue

I am trying to add the following function into my functions.php through the WordPress editor but every time I try it says error 403 Forbidden - Access to this resource on the server is denied! ...
0
votes
1answer
35 views

Custom URL scheme - paramters on custom post type

I have a custom post type set up as Event. Within this post type I have various bit's of content / custom meta which will be used on two or three different pages. I was wondering lets say I had my ...
0
votes
0answers
36 views

Rewrite rule is not working

I want a custom rewrite rule for my plugin. But for some reason it is not working. I tried flushing url, registered query var. But still it wont work and it gives output like this: ...
2
votes
1answer
221 views

Change the Permalink for wordpress attachment

My attachments are currently rewritten from http://localhost/?attachment_id=3 to http://localhost/images/image-title using @Bainternet's answer here. $new_rules['images/(\d*)$'] = ...
1
vote
1answer
53 views

Apache Fallback instead of add_rewrite_rule

My requirement is to do SEO Friendly URL for an existing site in Wordpress. For example, Current URL: http://test.com/test/?pid=19971 that is the page "test" is rendering the data from some custom ...
2
votes
1answer
139 views

Add specific word to default page permalink

Right now I am working on one of my client's project. Its all about amazon product display. My client wants me to change the permalinks of all posts, pages, serch results, archive pages, ...
1
vote
0answers
57 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 ...
0
votes
1answer
92 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 ...
1
vote
1answer
51 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
34 views

Hooking “delete_option_rewrite_rules” for rewrite rule addition

I'm trying to find the most efficient way to ensure my word press "rewrite rules" are set correctly in the event that another plugin calls the flush_rules() function. Traditionally I've seen ...
0
votes
0answers
43 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 ...
1
vote
0answers
53 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( ...
1
vote
1answer
177 views

Rewrite rule for admin-ajax.php

I went through a lot of posts and googled a lot, but still couldn't get this to work. I'm trying to create a rewrite rule for admin-ajax.php, to achieve the same results shown here: Adding ...
0
votes
0answers
47 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
1answer
179 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' ...
1
vote
0answers
75 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: ...
0
votes
1answer
86 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
83 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 ...
1
vote
2answers
212 views

Make Two Views of Post Type Archive At Two URLs

Updates 6 Feb 14 to make more specific as requested in comments. I have a post type, we'll call it "Projects", with the slug "projects" for which I'd like to offer two views: list view (default) ...
0
votes
0answers
34 views

Rewrite rule for custom parameters

Im having rewrite rules like this add_rewrite_tag('%offercode%','([^&]+)'); add_rewrite_tag('%offerdatefrom%','([^&]+)'); add_rewrite_tag('%offerdeparture%','([^&]+)'); ...
1
vote
1answer
76 views

flush_rewrite_rules() cancels the effect of add_rewrite_rule()

As one of my plugin's features, I'm trying to define a custom url structure, like http://www.mysite.tld/foo/{action}. I'm using add_rewrite_rule() along with flush_rewrite_rules() on plugin ...