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
0answers
201 views

Help with multisite redirect issues using Cherokee OR solid nginx config?

A little background: We've decided to abandon Apache because it can't keep up with the demand we're putting on it. We have a cron script that will create a new post about once every 3 or 4 seconds ...
0
votes
2answers
2k views

nginx + W3 Total Cache: rewrite rules issue [closed]

nginx 1.2.7 + WP 3.5.1 + W3TC 0.9.2.8. Rewrite rules generated by the plugin simply don't work, server returns 404 after including them in nginx server config. Or maybe I'm doing something wrong? ...
0
votes
2answers
144 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 ...
2
votes
2answers
2k views

Rewrite Rules for Multiple (more than 2) Taxonomies

I am using woocommerce and have some 'product attributes' which are just a taxonomies. I have the following taxonomies: pa_color pa_material pa_style the pa_ stands for product attribute and it ...
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 ...
2
votes
1answer
192 views

Rewriting URLs in Wordpress

I am trying to solve a rewrite problem but don't fully understand how to read the below code. I believe the event/industry/(.+)/?$' is stating the format I want in my new url after rewritten, which ...
0
votes
2answers
99 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
1answer
62 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
66 views

Wordpress Rewrite Rule

I have a standard page setup at http://mysite.com/mypage/ I'd like to setup a rewrite rule in my theme functions that takes any URLs such as: http://mysite.com/mypage/helloworld/ <-- Currently ...
0
votes
2answers
66 views

Remove .htaccess portion upon plugin deactivation?

I have a plugin that inserts some rewrite rule in the .htaccess file. However, upon deactivating it, doesn't remove said rule. The rule is nested in # BEGIN My plugin and # END My plugin. I want to ...
2
votes
1answer
4k views

Permalink rewrite 404 conflict- WordPress Taxonomies/ CPT

Wondering if someone could tell me why sub pages (child pages) no longer work (eg: www.mysite.com/type/childpage). I have a page called "Type" (working fine), and I wish to have Child Pages of "Type" ...
0
votes
1answer
87 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
309 views

Custom page template query_vars

I created a custom page template movie-page.php and a page movie in WP. The template shows fine when I visit site.com/movie/ I want to add movie_id as a query var. Here's my code: ...
0
votes
1answer
137 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
136 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
50 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 ...
2
votes
0answers
81 views

Page Attachment Permalink Structure based on Menu Order?

I've been on a quest for the past couple of days reading up on Rewrite in WordPress but still can't seem to figure out how to accomplish this. When using pretty links in WordPress, media attached to ...
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
1answer
4k views

Can a custom post type have a Parent Page?

I've seen a lot of posts out there in the Webiverse about assigning a page as a parent of a custom post type. After four hours I can't find a solution and need some help. I've create an "About" page ...
4
votes
2answers
526 views

Preserving $_GET parameter while using custom Rewrite Rule

This third party add-on plugin for Gravity Forms allows you to edit existing posts via the front end when you embed a form in your chosen template. All you need to do is append the GET ...
1
vote
1answer
464 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
2answers
312 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 ...
0
votes
2answers
140 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 ...
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 ...
0
votes
1answer
273 views

Why wp redirects me to wp-login.php when I visit a rewritten wp-admin URL?

I have this rewrite rule ^dashboard(.*) wp-admin$1 [L] and wp redirects me to wp-login.php when I try to visit /dashboard (even if I am logged in) Any idea why this happen, and how I can solve ...
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 ...
0
votes
2answers
785 views

Rewrite Rules Are Redirecting and Not Passing VARs

I have the following code in my functions.php file. <?php add_action('init', 'flush_rewrite_rules'); function custom_add_rewrite_rules( $wp_rewrite ) { $new_rules = array( ...
2
votes
3answers
2k views

Multiple post types - share same ReWrite slug?

I've run into another wonderful 404 issue. I'm trying to have 2 seperate post types that share the same rewrite slug. I've flushed my rewrite rules, and when I test only 1 of the CPT works- the ...
0
votes
1answer
140 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 ...
2
votes
2answers
4k views

Removing taxonomy base using WP rewrite

I´m trying to create the following URL structure: example.com/attractions <-- post type archive example.com/attractions/taxonomy_term <-- taxonomy archive ...
2
votes
1answer
360 views

WordPress custom URL Rewrites redirecting not masking

I have the following code that exists in a plugin that is meant to take a request to the url /stores/directory/foorbar/ and pass foobar as a GET variable: function pcrr_rewrite_rules($a) { $k = ...
3
votes
1answer
568 views

Modify custom post type rewrite rules in a separate function

I want to modify the rewrite rules for a custom post type, tribe_events, which is registered as a post type within "The Events Calendar" core plugin files (the-events-calendar.class line 24): ...
0
votes
2answers
251 views

How do I make WordPress revise an .htaccess file a certain way?

I've learned just a slight bit with WordPress Rewrite API -- just enough to add another rewrite rule for a plugin. The plugin works if installed in the root, but I'm finding that if one installs ...
0
votes
1answer
367 views

Tricky URL rewrite with custom values in url

We have custom post type as user_images and each of these post has a image attached with image name is 3 digit number followed by extension. When the url http://mysite.com/wp_username/3digitnumber ...
1
vote
1answer
97 views

How to Create a Custom Slug for Tags and Categories with a prefix or suffix?

I wanted to rename the slug to use a custom rewrite with a prefix or suffix that I choose. For example, if the tag name is "product" I want to use a rewrite with a slug that says ...
1
vote
3answers
518 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/([^/]+)/([^/]+)/([^/]+)/?$', ...
13
votes
1answer
3k views

When should add_rewrite_tag() be used?

I've spent a few days trying to learn how to best add rewrite rules. So far my understanding is that a suitable way to add simple rules is to use add_rewrite_rules(), with large thanks to Jan Fabry on ...
3
votes
3answers
2k views

Need help with friendly URL's in Wordpress

I'm creating som custom templates in Wordpress and I'm passing some data in the URL's. Currently my URL looks like this: http://www.mysite.com/designers/?id=43&name=designer+name The URL ...
0
votes
1answer
187 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', ...
1
vote
0answers
127 views

404 (category, pages, archives) when using custom rewrite rules

I'm using www.domain.com/%POSTNAME%/CAR permalink structure (CAR is the variable i need to extract. After adding the code to the functions.php the other wordpress url's stopped working (category, ...
1
vote
0answers
105 views

URL Rewrite with Custom Variables

I right now have a custom post type with a url structure like: example.com/videos/taxonomyname/ I have a custom variable that I am detecting in the template file to switch layout views which works ...
0
votes
2answers
422 views

How can I allow trailing slashes on some URLs without a redirect, but not on others?

Here's the scenario. Assume I have a site, wordpress.site, which has the following Permalink structure: /%postname% Assume I then set up the following posts: /post1 /post2 /post3 If someone were ...
3
votes
2answers
459 views

How to use Post Custom Metadata in Post Titles and Post Permalinks

I am very new to WordPress. How can I use post custom metadata in place of Post Titles, and as the Post Permalink? For example, instead of domain.com/the-post-title, the permalink would be ...
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 ...
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 ...
2
votes
2answers
4k views

How to modify URL structures in custom post types and taxonomies or terms

I am well aware that there are several posts covering the topic of customizing the permalink URL structure of custom post types, custom taxonomies, and taxonomy terms. However, none of them are real ...
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
293 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 ...
3
votes
1answer
551 views

How do you permanently remove default rewrite rules from the wp_options table?

We have tons of rewrite rules saved in our wp_options table and I'd like to permanently remove any entries that we're not using on our site (such as comment feeds, page attachments, etc.). What's the ...
2
votes
1answer
163 views

How to debug removal of rewrite rule flushing?

I use Custom Post Types. I try this: functions.php add_action( 'admin_init', 'flush_rewrite_rules' ); Now I’d like to remove this again. I try this: remove_action( 'admin_init', ...