Tagged Questions

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
2answers
203 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
656 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
254 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
634 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
40 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
190 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
248 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
219 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
420 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
953 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
768 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
309 views

Keep requested/entered url with add_rewrite_rule

I've got url-rewriting partially working. I have this rule: ...
2
votes
2answers
951 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
795 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
778 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
762 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
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
302 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
728 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
503 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
63 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
551 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
139 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
102 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
507 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
898 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
417 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
665 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 ...
0
votes
1answer
236 views

Rewriting permalinks with custom posts

I've created a custom post type, let's call it 'product'. The site is also bilingual, without any plugins, where I place localised pages under parent language pages, such as: English Page 1 Page 2 ...
0
votes
1answer
602 views

Rewrite loading custom template file but is_home() returns true, and there's no 404

I want to create some custom pages for my theme that don't appear in the Page listing in wp-admin. I have the following class which intercepts the url. class jtvRewrite { var $path = ''; function ...
0
votes
2answers
485 views

Custom post type permalink structure

I've browsed tons of Q/A on stackexchange, google, wordpress forums... but haven't found yet a definitive answer to what looks like to be a common issue since the introduction of custom post types. ...
0
votes
1answer
301 views

Can’t use a specific custom URL (slug)?

I’m having some problems understanding an error I’m getting. I have a page which is called “pitch” and as such the URL and the slug should be “pitch” as well, so: www.my-domain.com/pitch/ But when I ...
0
votes
1answer
629 views

Rewrite rules for custom post type

There is a nonhierarchical custom post type "news". /news/ /news/page/2/ /news/post_slug/ Each post has custom field "views". When someone opens post, field's value increased by one. Would 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 ...
0
votes
2answers
591 views

Viewing category pages without the word 'category' in URL

When I view a static page its url is like: http://example.com/mybooks/ When I view a category page its url is like: http://example.com/category/books-ebooks/ For SEO, I want some modification so ...
1
vote
2answers
3k views

Custom post types and custom variables — add_rewrite_tag() question

I'm stuck on this, and have no idea what I'm doing. I have a custom post type called areas, that is hierarchical. We want to pass a variable into the page, and have it be pretty. Currently, it is: ...
0
votes
1answer
437 views

Custom taxonomy and post type rewrite rules

I'm working on portfolio site, where I need to create a "portfolio" post type and divide posts in it by categories with urls like "/portfolio/category/", so the "category" is the category term. ...
0
votes
1answer
2k views

Rewrite rule that wp-login.php?action=register is left alone

Unfortunately buddypress breaks a facebook connect script because of the rewrite rules. It changes /wp-login.php?action=register into /register/ I tried to find where the custom rewrite rule is ...
0
votes
1answer
138 views

How to Use metada Value in Url and is it possible? [duplicate]

Possible Duplicate: How to use Post Custom Metadata in Post Titles and Post Permalinks hii i want to know that how can i use my metadata value for post url which i add with my every post in ...