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
1answer
373 views

Rewrite rule for a query string

I have a taxonomy search form and the link output is http://localhost/wp/?cityid=16 But i want it to be rewrited as http://localhost/wp/cityid/16 .htaccess # BEGIN WordPress <IfModule ...
1
vote
0answers
86 views

Getting 404 error on my wp rewrite error

The code I'm using to rewrite urls with query vars: function add_query_vars($aVars) { $aVars[] = "city"; $aVars[] = "address"; $aVars[] = "pg"; return $aVars; } // hook add_query_vars ...
0
votes
1answer
279 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 ...
1
vote
0answers
136 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 ...
1
vote
1answer
394 views

remove_query_arg() on rewrite rule

I'm attempting to add a Back to Search Results link which in essence will simply link back to the starting search page - for example /?s=test. I've taken a look at the global query vars and do see ...
1
vote
1answer
94 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 ...
1
vote
0answers
908 views

How to change “attachment_id” in attachment permarlink?

I changed attachment permalink by add_filter('attachment_link','my_media_url'); from http://domain.com/?attachment_id=123 to: http://domain.com/?media=123 The change is successful. But, with the ...
5
votes
2answers
3k views

Change the “page” slug in pagination

Simple question. When pagination is activated, the URL changes to "site.com/page/2". For my site, this should be "site.com/paggetto/2". How can I change that rewrite rule? I also want to change ...
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
918 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; ?>" ...
2
votes
1answer
1k views

Permalink rewrite with custom post type and custom taxonomy

I think thats a quick one: I've got: Custom post type: Food Custom taxonomy (Registered to Food): Fruits Terms in Fruits: Apple, Orange, Cherry If I type in example.com/food?fruits=Apple,Cherry, ...
1
vote
1answer
444 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 ...
0
votes
1answer
156 views

Problems with rewrite rule

I realy cant to figure this out. What i want to do, is this URI http://www.hotels-lithuania.net/index.php?page=76&type=hotels&id=1 transform to http://www.hotels-lithuania.net/item/hotels/1. ...
0
votes
1answer
272 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 ...
3
votes
1answer
499 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
1answer
334 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 ...
1
vote
1answer
175 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 ...
4
votes
3answers
542 views

How to add a custom URL placeholder to author archives?

I am working with a client who has a directory site that allows users to create accounts, then lists of items from the directory. Right now, whenever a user creates an account, she gets a profile URL ...
0
votes
1answer
171 views

New rewrite rules for custom taxonomy and reuse default

I have a taxonomy location. All terms except one are to be treated differently. That's why I have two php files taxonomy-location.php taxonomy-location-national.php Now, I want to make the URLs ...
0
votes
1answer
527 views

Custom Post Type Date Based Archive URL rewrite [duplicate]

Possible Duplicate: custom post types, wp_get_archives and add_rewrite_rule I have a custom post type called "course" and I would like to create a date based archive similar to the default ...
0
votes
1answer
491 views

Rewrite Rules problem when rule includes homepage slug

I have page Example (ID=443, slug=example) that is configured, through Dashboard->Settings->Reading, as the home page of my WP site. I also have the following rewrite rule configured: ...
0
votes
2answers
202 views

Help with url rewrite

How can I turn a URL like: http://site.com/?project=5 into: http://site.com/project/5/ ? I was looking the rewrite doc here: http://codex.wordpress.org/Class_Reference/WP_Rewrite#Examples and ...
5
votes
1answer
1k views

add_rewrite_rule() vs $wp_rewrite->rules vs 'rewrite_rules_array'?

I've written Rewrite rules for my custom post types. they work well except that WP doesn't update the url in the User Agent when the redirect_url doesn't match the requested_url. everything else ...
1
vote
1answer
618 views

Does WP Have a Function To Generate .htaccess RewriteCond?

I know that I can edit .htaccess manually and add a RewriteCond statement inside, but I need to build a plugin that does this the proper way by using WP rewrites which then get pushed into .htaccess ...
0
votes
1answer
248 views

Rewrite /category/cars into /topics/cars

I know there are plenty of question and posts about this out there, however I couldn't find a solution or existing thread to my specific question. If I list my categories and click on "cars" the url ...
2
votes
3answers
581 views

flexible rewrite 'ramble' URLs with Wordpress

I want to access my post with id 17 like this: http://localhost/archives/17/moot-bla-foo-ramble In other words, the id shall decide, everything thereafter may (or may not) be the slug or anything ...
0
votes
1answer
39 views

Need Help with Custom ModRewrite

How can I correctly send all traffic from: http://my-domain.com/about/case-studies/clientName/ to http://my-domain.com/about/case-studies/?clientName=$clientName (not seen by visitors) ...
0
votes
1answer
185 views

Wordpress custom permalinks, pages are now 404

I've set my permalinks to a custom structure: /%menutype%/%postname%/ This works all right for my custom taxonomy (menutype) and anything that's an archive. Now however, simple pages won't work, ...
1
vote
1answer
245 views

How To Consistently Enforce Rewrite Rule in Plugin Development

Let's say I create a customer support plugin that hijacks the /support part of the URL and redirects it to an MVC framework in my app folder of my plugin folder, like so: RewriteRule ^support(.*)$ ...
1
vote
1answer
218 views

Best structure / rewrite rules to achieve the following url

I have been trying to achieve the following url structure in Wordpress and maintain a level of reusability in the admin area. It is for a client preview area and needs to reflect multiple versions of ...
0
votes
2answers
2k views

Rewrite-Rules not working on a vhost, everything goes to index.php

after setting up the wordpress htaccess rules in my vhost, i was unable to enter the wp-admin area. I was always redirected to the frontpage of my wordpress instance. The rewriting itself worked on ...
4
votes
1answer
405 views

Custom Rewrite Rules Not Sticking

I've written some custom rewrite rules for a special feature on http://www.pewhispanic.org/states/. States is a page with a custom page template, page-states.php. The logic for returning the right ...
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 ...
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 ...
1
vote
3answers
918 views

Custom Post Types: pretty search URLs and has_archive

This is a question based on the comments from the answer here. I'm using the following code to create a couple of different search boxes for my website: <form action="<?php echo home_url( ...
6
votes
0answers
707 views

add_rewrite_endpoint() not working for custom post type archives [closed]

i'm working on somekind of wiki/encyclopedia system based on wordpress. there are two custom post types. i'll show my configuration for one of them: $labels = array( 'name' => _x('Objects', ...
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 ...
0
votes
1answer
299 views

Keep requested/entered url with add_rewrite_rule

I've got url-rewriting partially working. I have this rule: ...
2
votes
2answers
893 views

Customising rewrite rules for CPT single post URL to work as paged URL

I've got a CPT called Service registered as following: $args = array( 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'has_archive' => false, ...
3
votes
0answers
421 views

How do I rename the wp-admin folder with the admin_url filter? [duplicate]

Possible Duplicate: Can I rename the wp-admin folder? I have applied some mod_rewrite rules to redirect /wp-admin to /my-admin - based on this tutorial. I also changed the admin url ...
2
votes
1answer
787 views

How to rewrite custom post type with custom taxonomy urls?

I am working in a WP multisite which runs on a classipress theme and there is a custom post type "ad_listing" and custom taxonomy type "ad_cat". Now the url is like this ...
5
votes
3answers
751 views

How-to add rewrite rules to point the uploads folder to a subdomain

The goal Point the upload-folder to a static subdomain to serve adaptive images, that can get cached. WordPress Rewrite Rules You can read more in detail about rewrite rules API at Christopher Davis ...
0
votes
2answers
702 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( ...
1
vote
1answer
3k views

Custom post type permalink endpoint

I have a custom post type called "destinations" and I have set the EP mask for the post type to default EP_PERMALINK. I have added a couple of endpoints as follows : add_filter( 'query_vars', ...
1
vote
1answer
286 views

Can't add external rewrites

I've got the following code in my functions.php function add_custom_rewrite_rules(){ add_rewrite_tag('%gallery%','([^/]+)', 'gallery='); add_rewrite_tag('%album%','([^/]+)', 'album='); ...
1
vote
1answer
1k views

Rewrite wp-login.php URLS to static pages?

I'm struggling with getting a few things in WP to redirect. I'm using a front-end profile / profile editor, and I'm also using a front-end login/register. Naturally I would like to redirect the ...
4
votes
1answer
680 views

add_rewrite_rule not producing anything in $_GET

Trying to get pretty permalinks happening for a plugin that displays events I have this: function my_add_rewrite_rules() { global $wpdb; $org_options = get_option('event_settings'); // ...
0
votes
1answer
74 views

Leverage WP_Rewrite to pre-validate links / detect invalid links

I'm automatically generating links to (supposed) pages/posts. These links are generated by get_permalink( $post->ID ), so in_theory, should be valid links. Unfortunately, in some situations, where ...
1
vote
3answers
462 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/([^/]+)/([^/]+)/([^/]+)/?$', ...
3
votes
0answers
61 views

Add /demo/ slug with rewrite rule [duplicate]

Possible Duplicate: Add extra parameters after permalink? I need to add a slug to every post. Current permalinks http://www.my-domain.com/2012/01/01/my-post-title/ or ...