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
485 views

.htaccess rewrite

I have created a custom post type called 'event' and added an event called London 2012. I want the following URL structure for a page: local.mysite.com/london-2012/speakers I have created a page ...
0
votes
3answers
3k views

How to enable hierarchical permalinks for hierarchical taxonomies

If you have a category called "term" and a subcategory called "subterm", your can access subterm posts at /cat/subcat. But this doesn't work out of the box with custom taxonomies. They are ...
1
vote
1answer
369 views

Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?

I've added a myvar/myvalue rewrite endpoint to EP_ALL which can be added to any URL of a WP installation and a WP plugin will act upon it. That part is cool but it doesn't work when the permalink ...
0
votes
1answer
115 views

How to use WP_rewrite?

I need to add the following rewrite commend to WordPress .htaccess file: RewriteRule ^read/([0-9]+)/?$ /read/?u=$1 [QSA,L] How to do this by a function? i.e., how to do it by use wp_rewrite in ...
0
votes
1answer
196 views

Permalink/Pagination issue: Category base name same as page name

I currently have a page called "Blog" (slug "blog"), which loads a index.php. All posts in index.php belong to only one post category. A sidebar on index.php contains category links (via ...
1
vote
0answers
162 views

Pretty URLs and custom post types

I've read the posts on WP SA on rewrites and custom post types, but I can't figure out why my search for 2 different post types isn't working. I'd like my URLS to become ...
0
votes
1answer
744 views

Passing value as hidden parameter to next page

I am trying to send value from one page to another page in WordPress as i do not want to repeat logic to fetch that value in other page. I am not very proficient in WordPress/PHP, if i have to do that ...
2
votes
2answers
422 views

Add rewrite endpoint to author page + pagination

I want to add a new endpoint to the author page, so that the URL looks like this: http://example.com/writer/username/articles So far, I have: Changed the author base Added a rewrite rule Setup ...
1
vote
1answer
43 views

How to turn this .htaccess rule into a dynamic rule with add_rewrite_rule, et al?

In .htaccess, I have this: RewriteRule ^land/(.*) /?land=1&exper=$1 [QSA,L] which makes sth like this: domain.com/land/exper1 fill in the $_GET with $_GET['land'] = 1 and $_GET['exper'] = ...
1
vote
1answer
244 views

Why doesn't flush_rewrite_rules run on plugin activation?

I'm trying to flush rewrite rules in a plugin and it isn't working. I have to go to permalinks -> save in the admin panel for the rewrites to flush. Can anyone see why? class SpektrixPlugin { public ...
-1
votes
2answers
186 views

Custom url rewriting

I am struggling to create custom rewrite rules for wordpress. This is my url structure http://domain/cityprofile/?city=Sydney where city profile is a page template. Now i want to make this url ...
0
votes
1answer
46 views

Rewrite rules goes away

I have a strange issue. The custom rewrite rules are registered correctly in my plugin activation hook. But, if I go to the permalinks settings page and clic on "Save changes" I lost the rewrite rules ...
4
votes
3answers
536 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
0answers
63 views

Rewrite author_name

I need to rewrite author_name to cat. I searched for hours but can't find anything. I restrict the search results by author instead category because of the performance, it's much faster. For getting ...
0
votes
2answers
307 views

WordPress Rewrite rule is not working

I am trying to create a rewrite rule for one of my custom page and here is the rewrite rule function add_my_rule() { global $wp; $wp->add_query_var('name_state'); ...
2
votes
2answers
85 views

When is it a good idea to build a permalink structure from scratch?

Is it a good idea to design a permalink structure from scratch? The requirements to the structure are as follows: Pages to be referenced by their structure ...
1
vote
2answers
136 views

rewrite rule to redirect to the most recent date permalink

I've got an archive that's displayed using a URL on the form www.mysite.ex/mycpt and I need to make a rewrite rule for that URL which redirects to a permalink with the latest date archive, which is on ...
0
votes
0answers
580 views

Adding rewrite rules to Custom Post-type mixed with Taxonomy

I turn to you because I can not find any solution to my problem. I created 3 custom post types "Actualités", "Dossiers", "Vidéos" (I'm french :D) I created 1 taxonomy: "Thématiques" with the ...
4
votes
1answer
180 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 ...
0
votes
1answer
110 views

custom post type archive page has 404 error even though has_archive is true

I have an existing site that has a custom post type with no archive. It has been live for almost a year now. I am trying to change the custom post type to have an archive now. So I changed ...
1
vote
0answers
33 views

Specific routing for CPT

I'm developing site for art gallery. A have Artist CPT (internal name artsin_artist) which is defined in my functions.php like following: register_post_type('artsin_artist', array( 'labels' => ...
0
votes
1answer
86 views

What is the proper way implement a global $wp_rewrite?

The below code works correctly, but I don't know if it is proper coding. Can anyone confirm or comment on the code? add_action('init', 'news_rewrite'); function news_rewrite() { global ...
0
votes
1answer
65 views

rewrite rules add a folder in the path

I have to do some url rewritting for custom post types. I have 2 custom post types: portfolios and locations. What I need to change is the url like this: current: ...
1
vote
2answers
80 views

Wordpress Rewrite

I'm trying to get http://example.com/site/vendors/?u=abc to rewrite to http://example.com/site/vendors/abc but I can't for the life of me figure out how to get the url rewrites to work. /site/ is the ...
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 ...
0
votes
0answers
55 views

Custom Rewrite for Profiles

I'm currently trying to modify my rewrites to allow for an additional URL segment e.g. http://example.com/vendors/username/ by default WP allows for additional numeric segments but everything else ...
0
votes
1answer
52 views

Wordpress Custom Rewrite Rule

I have a custom page template to use for a wordpress page. I am trying to setup a custom rewrite rule but without success. I have a page at blog/book-page/, the display of this page depends on the ...
1
vote
1answer
203 views

Remove rewrite rules generated by plugin during deactivation‎

I have a simple plugin like the following add_action('generate_rewrite_rules', function ($wp_rewrite) { $wp_rewrite->rules = xxx + $wp_rewrite->rules; }); if (is_admin()) { ...
1
vote
0answers
117 views

Rewrites with hierarchical taxonomies in permalink

I am attempting to create a hierarchical list of products in WordPress 3.5.1. For example if the custom post type product was in the custom taxonomy Outdoor > Garden Tools > Hoses, these would ...
1
vote
0answers
161 views

Move wp-content htacess

I notice that when I rename the wp-content and plugins folders http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content my multisite network htacess still references wp-content: see this ...
0
votes
0answers
62 views

htaccess problem not being able to overwrite previous rules

so guys, what i need to do is: whenever someone ask for this url: dev.site.com/noticias/id/tittle-for-the-news ( dev.site.com/noticias/([0-9]+)/([A-Za-z0-9-]+)/ ) it needs to get this: ...
1
vote
1answer
198 views

Pre-Populate $wp_query settings with custom rewrite rules and custom template_redirect

I'm currently working on a file browser plugin which requires frontend editing capabilities for a registered user. For this scenario, I have registered some custom rewrite rules for my custom post ...
0
votes
1answer
53 views

Rewriting WordPress URLs

I've got a plugin which takes input through a GET request via a shortcode. The shortcode is placed on a page with the address /search, and the query used to execute this particular piece of the search ...
1
vote
1answer
2k views

How to Rewrite Wordpress URL for a Plugin

I am trying to build a Wordpress plugin here with a custom user admin area. What I would like to do is when the user adds /edit at the end of the page, it should open a page from my plugin. So for ...
0
votes
1answer
111 views

Rewrites rules disappear after a while

My Plugin I implemented a small plugin to be able to show events with a specific custom field in a special order. To have some nice permalinks I also used the add_rewrite_rule function to add those ...
2
votes
1answer
197 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'); ...
4
votes
1answer
396 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
287 views

Adding paged query to custom URL rewrite

I have set up the following to create 'pretty' post type and category permalinks: function kdev_add_category_rules() { $post_types = array( 'kdev_photos', 'kdev_videos', ...
0
votes
1answer
367 views

Redirect URL to an existing page with query string or #! added on

I'm trying to make a photo gallery where the individual photos can be shared on Facebook and Twitter, and when you click the link, the photo that was shared will open in a lightbox automatically. ...
0
votes
1answer
293 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, ...
5
votes
1answer
377 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
176 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 ...
1
vote
4answers
3k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
0
votes
0answers
209 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 ...
2
votes
2answers
1k views

How to trigger 404 for custom query var?

How can you trigger a 404 when using custom query vars? I've got re-write rules written for a custom query var, but if you were to request a URL for the query var that should technically be a 404 it ...
0
votes
0answers
83 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
56 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 ...
5
votes
1answer
1k views

Rewrite Rule for Multilingual Website, Like qTranslate?

I would like to write my own little plugin for language switching. For that, the very first thing would be to get the rewrite rules running. I have been looking around the web for 2 hours, but I ...
3
votes
3answers
275 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
2answers
145 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( ...