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

Access $_POST data after redirect

How can I access $_POST data after a page redirect? I guess there is some way to tell WordPress to pass all $_POST data to the redirected address, like it does with $_GET data, using Rewrite Rules, ...
1
vote
3answers
456 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 ...
5
votes
1answer
416 views

CPT Template Not Showing - Getting 404

I'm developing a Custom Post Type plugin, which works fine in dev. Now that I've moved it to production, I'm getting a 404 when I try to display the template for the CPT. So, two questions: 1- Is ...
0
votes
1answer
200 views

Per Page Permalink Structure for Page Post Type

I am trying to Re-Write Page URL's so that they END with .htm I was able to do this using... /* Add .htm extension to Page URL Links */ add_action('init', 'htm_page_permalink', -1); function ...
0
votes
0answers
246 views

permalink and add_rewrite_rule - error 404

I'd like to have comments in a separate page with a dedicated template only for posts in a specific category (slug shops). Example: mysite.com/post-incatshops --> mysite.com/post-incatshops/comment ...
0
votes
0answers
91 views

standard post with extra parameter brings permalink problem

This problem concerns several rewrite rules, but i'll stick to one, for clarity. In my theme, i use a parameter "parentid" which gives me the page/post/custom post i've clicked on (the parent). in ...
0
votes
1answer
57 views

Custom Rewrite Problem

I'm creating some custom rewrites using the code below. Everything works fine, as far as urls such as this: example.com/reviews/showname Tells my theme to use the special archive page and passes ...
0
votes
1answer
221 views

Wordpress in “Couch Mode”?

I am trying to setup a "Couch Mode" (distraction free reading) on my WordPress blog as laid out in this article. The guide in the article follows these steps: Create a new page in WordPress with ...
3
votes
3answers
293 views

rewrite_rule() not preserving the query string

We have added a custom rewrite_rule to our site to allow for a pretty inbound link to be parsed and handled properly. Links are constructed as domain.com/meetings/faculty/someIDnumber add_action( ...
0
votes
1answer
162 views

Rewrite and replace url wp-admin/edit.php and wp-admin/post-new.php

everybody I want to rewrite and replace all url mydomain.com/wp-admin/edit.php -> mydomain.com/wp-admin/edit/ and mydomain.com/wp-admin/post-new.php -> mydomain.com/wp-admin/addnewpost/ How i ...
0
votes
2answers
157 views

Paginate yearly archives for a custom post type

Here's the code I'm using to create yearly archives for a custom post type: function myquery_custom_post_rewrite( $rewrite_rules ) { $myqueryslug = 'customposttype'; $month_archive = array( ...
1
vote
1answer
157 views

Custom Rewrite Rules

I am developing a plugin, the goal of which is to allow for a bookmark-able, pretty permalink search engine on a single page. To do so, I am using WP's rewrite rules to allow for the ...
1
vote
0answers
197 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
141 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 ...
0
votes
2answers
98 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 ...
1
vote
3answers
352 views

Custom post type paging 404 error

I've an issue on custom post type, I've create a custom post type called "Agenda" and the rewrite url for http://example.com/agenda it works correctly, it points to the archive-agenda.php template ...
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
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
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
234 views

Custom taxonomy on permalink

I have a long time problem and look forward for your help. I have a custom taxonomy of "city" (it is no hierarchical like tags). I just would like my URLs to look like this: ...
1
vote
3answers
589 views

Pagination: /tags/tag_name/?paged=2 gives a 404 error

I need to paginate an archive page. Pagination works perfectly fine for everything except tag/category archives. Basically if I use /tags/tag_name/?paged=2 it gives me a 404 error. But if I use ...
0
votes
1answer
86 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
297 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
136 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
131 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 ...
1
vote
2answers
406 views

Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess

For a long time I served my blog from http://www.murrayc.com/blog/, with the wordpress installation in /home/murrayc/murrayc.com/blog/. Now I've moved it to http://www.murrayc.com/, without moving the ...
2
votes
0answers
78 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
117 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', ...
4
votes
2answers
523 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
2answers
301 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 ...
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 ...
0
votes
2answers
137 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 ...
3
votes
1answer
230 views

WordPress Custom URL Rewrites

I am trying to add a custom rewrite rule with a single variable to a specific page. The 'ugly' version is http://example.com/used-cars/car/?carname=name-of-car and the 'pretty' version I'm going for ...
-1
votes
1answer
399 views

How to redirect image attachment to its original post

I'm making a slider that is getting images from attachments in the post. I am trying to rewrite the url for the post so that if someone pastes the direct url to the attachment, it'll go the post ...
0
votes
1answer
136 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 ...
3
votes
2answers
461 views

Make post slug have priority over category slug

I have a wordpress site where the category base is stripped from the url. Now, when a category has a certain slug that's similar to a post slug, the category is shown. I would like to show the post ...
2
votes
1answer
190 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 ...
1
vote
1answer
313 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
247 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
357 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 ...
4
votes
1answer
187 views

Permalinks so that one custom post type appears to be a child of another, not working

Currently I have two post types, "products" and "products-data" they are separate post types; however, for all intents and purposes products-data is a child post of products. The relation is ...
1
vote
1answer
96 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 ...
0
votes
1answer
480 views

Custom url structure - pages under a custom post type

I'm struggling with the structure of my Wordpress site and I was hoping you might be able to give me some advice. The site is for a series of events and the structure is as follows: Gateway ...
12
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 ...
0
votes
1answer
185 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, ...
2
votes
1answer
216 views

Custom rewrite rule is not picked by Wordpress

I am trying to create a custom Rewrite URL something like function add_my_rule() { global $wp; $wp->add_query_var('state'); $wp->add_query_var('state_destination'); ...
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 ...