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

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
436 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
155 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
270 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
472 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
329 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
534 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
169 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
503 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
478 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
610 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
245 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
571 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
180 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
242 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
217 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
395 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
903 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
678 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
296 views

Keep requested/entered url with add_rewrite_rule

I've got url-rewriting partially working. I have this rule: ...
2
votes
2answers
873 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
420 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
782 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
749 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
680 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
2k 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
277 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
663 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
73 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
445 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 ...
0
votes
1answer
500 views

why is are these rewrite_tags and rules not working?

im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code: function add_video_rewrite () { ...
0
votes
1answer
130 views

help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]

Possible Duplicate: custom htaccess rewrite rule for page ok i made another post and i got pointed to the Rewrite API however, when i do print_r($_GET) on the page, it echos an empty array ...
1
vote
0answers
101 views

How do I write a custom API endpoint that accepts args and passes them into a function? [closed]

I'm writing my first WP plugin and feeling pretty lost. This should be a simple issue, but I can't seem to find any good tutorials or anything. Here's some code I've cobbled together from various ...
3
votes
1answer
4k views

Add Rewrite Rule for custom page

Was trying to create author specific page with author specific URL and it was working fine,but when i created this URL did not taken in to account following 2 factors Author Name Conflict (similar ...
3
votes
2answers
2k views

Clean URLs for custom $_GET variables

I have a query var show=othertemplate that I can add to any URL to show any post, page or archive in Wordpress in a different template, like this: mysite.com/[any URL]/?show=othertemplate. I'd like ...
0
votes
1answer
496 views

Rewrite custom taxonomy slug - but only parent items

I've set up a custom hierarchical taxonomy called 'region'. So now I have e.g. url.com/region/leeds/ etc. However, I'm now expanding to other countries, so I'm making the region sub-categories of ...
0
votes
1answer
1k views

add_rewrite_rule again

In general, the code from this question fit to me for 90%. One little change I need - I want all URL like *example.com/snpv/any_text/* direct not to index.php as in original code, but to my.php script ...
2
votes
3answers
838 views

How to add .htaccess code through a function?

I need to add the following .htaccess code through a function <IfModule mod_deflate.c> # Insert filters AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html ...
0
votes
2answers
393 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 ...
1
vote
3answers
621 views

flush_rewrite_rules not working on plugin deactivation, invalid URLs not showing 404

i'm just about to release a community plug-in and have a few last anoying issues. First, whenever i visit a page that would not be valid for the plugin, www.mydomain.com/forms/tester it will take me ...