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

Change the Permalink for wordpress attachment

My attachments are currently rewritten from http://localhost/?attachment_id=3 to http://localhost/images/image-title using @Bainternet's answer here. $new_rules['images/(\d*)$'] = ...
0
votes
0answers
12 views

How to prefix all rewrite rules in wordpress?

I want to prefix all permalinks in wordpress, and get this value from query_args. For example http://wp.dev/sample-page transform in http://wp.dev/en/sample-page. I want for all permalink, for page ...
0
votes
1answer
26 views

How do I turn off the blog and archives?

Is there a fixed set of htaccess rewrite rules I can use to "turn off" everything blogging related? It's not enough to just not show the links in the menu, I want to completely hide everything ...
2
votes
1answer
89 views

Reading Settings -> Front Page displays “Static Page” being reset

Every day my WordPress blog is going from a static page, back to "your latest posts". I am not setting this setting, something is doing this automatically! Any ideas what to check for? Is there any ...
0
votes
1answer
357 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 ...
0
votes
1answer
888 views

WP Rewrite Rules - Custom post type & taxonomy

I've been beating my head against the wall for a few days trying to figure this out. I have a custom post type and custom taxonomy and I'm trying to get my URL's to work. Here is the URL structure ...
2
votes
0answers
34 views

Rewrite rule page url with category

I have enabled the category box for pages with this: // Add to the admin_init hook of your theme functions.php file add_action( 'admin_init', 'page_categories' ); function page_categories() { // ...
1
vote
2answers
436 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 ...
0
votes
2answers
425 views

add_rewrite_rule not working for me

I have the following rewrite tags defined: // ADD REWRITE TAG FOR 'VEHICLE MAKES' add_rewrite_tag('%make%','([^&]+)'); // ADD REWRITE TAG FOR 'BODY STYLES' ...
0
votes
0answers
18 views

RewriteRule directive not working without [P] flag

I need to rewrite some URL's, but I ran into strange problem. For some reason RewriteRule directive only works if I use proxy flag, for example: RewriteRule ^foo$ /www_dev/test/page2-2/ [P] works as ...
0
votes
0answers
29 views

rewire rule for custom taxonomy of custom post type

So I have spent almost a week trying to solve this problem, I have a custom post type called Product with a custom taxonomy called Category. What I want is be able to list all products in a category ...
1
vote
3answers
654 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 ...
1
vote
3answers
377 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
0answers
24 views

add_rewrite Rule

I want to add a rewrite rule, the remove the "base" from a custom taxonomy link. There current structure is: http://example.com/bundesland/TERMSLUG I would like to have it like this: ...
0
votes
0answers
21 views

Remove rewrite path for custom taxonomy [duplicate]

I want to get rid of the rewrite path for a custom taxonomy. This is the way, I register it: register_taxonomy( 'bl_tax', array( 'stadt'), array( 'label' ...
1
vote
1answer
1k views

Custom query_vars and parse_request on wp-admin

I've read this post http://wordpress.org/support/topic/query-vars-in-admin and although it's quite an old question, it suits me perfectly. I'm trying to accomplish what I already posted here: ...
0
votes
1answer
534 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 ...
0
votes
1answer
312 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 ...
0
votes
1answer
30 views

How bad is flush_rules() on init hook?

According to the Codex: [...] This function can be extremely costly in terms of performance. It should be used as sparingly as possible - such as during activation or deactivation of plugins or ...
0
votes
1answer
53 views

How to check if last uri segment is a custom post type or taxonomy term?

After following Jeffs suggestion on this thread to create nested parent and child taxonomy terms within a permalink like... url.com/custom-post-type/taxonomy-parent/taxonomy-child/cpt-entry It ...
0
votes
0answers
24 views

Custom Post Type with Rewrite Rule and Paging

I am running WordPress 4.0 and I have created a custom post type called events-to-see which is a post. I wanted to get the events to display with the following url structure ...
5
votes
1answer
2k 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 ...
0
votes
0answers
40 views

How to completely overwrite and replace the permalink rewrite rules?

The site I'm working on has a very specific permalink structure, one that is very different from the default wordpress permalinks. I don't want to add rules; I want to replace the rules entirely with ...
1
vote
2answers
873 views

Display posts from Custom Post Type in category page on front-end

I created my Custom Post Type (bizdirectory), created a new post (Test Business) and created a new category (Business Directory). But if I add the Business Directory category (slug = business) to my ...
0
votes
0answers
24 views

Ignore specific URI segment

I've set up a custom post type and have it displaying correctly at /archive and /archive/single - what I want to be able to do is allow specific segments in place of /single to still show the ...
0
votes
0answers
12 views

Custom rewrite rules without a sub folder path to identify clash with pages

I need to be able to have routes to links that are both pages and products from the main wordpress root directory, without anything to distinguish between what a product (which is a template_redirect) ...
2
votes
1answer
79 views

add_rewrite_rule, plugin activation and plugin deactivation

I see a lot of example showing to call add_rewrite_rule in your init hook, e.g. function add_my_custom_rewrite() { add_rewrite_rule(... } add_action('init', 'add_my_custom_rewrite'); and in ...
0
votes
1answer
51 views

Add a query string to ALL links on site

Our client would like to embed his site into an iframe in their software backend. I get a query string on the first link but need to make sure that string persists across URLs for all links and ...
0
votes
1answer
25 views

If term and page have the same slug, how can I view the term archive?

I am using a custom taxonomy with the term slug 'nursery'. I'm also using a page with the slug 'nursery'. I can view the page fine, but trying to view the 'nursery' term archive page as fetched by ...
0
votes
1answer
44 views

Custom rewrite rules are sending everything to index.php

I'm creating a site where users work together on teams to create films. Currently, I'm setting up an edit page on the front end for team managers. I've just got a simple isset() check on a query var ...
13
votes
1answer
17k views

How to create custom URL routes?

I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
0
votes
1answer
35 views

Rewrite rules and query for virtual page

My question comes from this one. I have never really touched on rewrite rules as frankly, they still do not make sense to me What I have I have successfully build the following link ...
0
votes
1answer
21 views

How can you create a Permalink structure on a WordPress site?

Let's say I want to create a wordpress site that has a folder structure such as: http://www.example.com/cars/ http://www.example.com/cars/red-cars/ Yet I want people to be able to comment on both ...
0
votes
1answer
24 views

WordPress doesn't remember my custom rewrite rule

I have the following code: function b09_custom_rewrite_rule() { add_rewrite_rule( 'utils/([^/]+)/?', 'index.php?utils=$matches[1]', 'top' ); flush_rewrite_rules(); } ...
4
votes
2answers
785 views

Rewrite url for custom post type

I'm using WPML plugin to translate my site. I have a custom post type called "vinos" and I use this args: $args = array( 'labels' => $labels, 'hierarchical' => false, ...
0
votes
1answer
57 views

Using two permalinks for one post

Using two permalinks for one post I am developing a wordpress website for a client, the client want to show 2 separate templaes for post details the scenario will be. user clicks on post and our ...
0
votes
1answer
94 views

How to Add Pages Under Custom Post Type URL Structure?

How can I add pages under the URL structure of a Custom Post Type? For example... If I had a Custom Post Type called "Knowledge Base" ... Located at: domain.com/knowledge-base/ ... and I wanted to ...
0
votes
0answers
48 views

Loading different template on different url of same page

I have successfully add rewrite rule and tag for a page. My page slug is my-page. when my url is mysite.com/my-page then the right template is properly loaded. I have set a custom template for ...
1
vote
0answers
64 views

Pretty permalinks IIS gives 404 on posts/pages

I'm trying to get Wordpress to work under IIS and I've gotten stuck on custom permalinks. If I use the standard ugly permalinks, All standard features works fine, but plugins like Buddypress does ...
3
votes
5answers
5k views

URL Rewrite + Page + Custom Post Type = Unusual Redirect

Yet another URL rewrite issue :) The Problem I have a URL rewrite rule that should work, but against all logic it redirects without passing the query var. The Juicy Details The site has a page ...
0
votes
1answer
24 views

Custom urls in WordPress involving page slugs

I have a page called 'Cars' with slug cars. Is it possible that the page works as normal at this URL http://example.com/cars/ and http://example.com/cars/audi/ can be used to show something some ...
1
vote
1answer
13 views

Best action to call add_rewrite_rule

In Codex I found that the best action to call add_rewrite_rule is the init action. So in this way the function is called every time the site load. But to save the rule in rewrite_rules option it would ...
0
votes
0answers
38 views

How to get list of taxonomy slugs ordered parents>childs?

Is there an existing function in WordPress to generate a list of taxonomy slugs ordered by parents > childs > subchilds in an array? I need to generate a URL structure for my custom post type in ...
0
votes
0answers
20 views

Attempting to modify cpt archive with query var

I have a custom post type, messages (slug is watch), and I added a query var, speaker, as well as the rewrite. If the url is /watch/speaker/Speaker+Name it modifies the query to include that. If it's ...
0
votes
1answer
35 views

Add Custom Pagination Permalink

I'm trying to create a page with multiple loops on it and as such also need multiple pagination. This is proving to be a touch difficult, I've managed to get the links to show correctly by using the ...
1
vote
1answer
268 views

Need to add rewrite rule that adds in additional information about the post to url

A have a post type for venues which have the attributes title, state, and suburb. Currently using the default WordPress permalinks I get the following format: mysite.com/venue/{title} However, I ...
1
vote
1answer
22 views

Custom post type permalink returns 404

Mates, I've created a custom post type. Created some posts of that type, but when I try to access to any of them, I get 404 error. Also created single theme (single-pb_progproy.php). Here's the ...
0
votes
0answers
28 views

PHP Rewrite Wordpress Folder to act as query string variable throughout site

I'm hoping in this is a possibility with Wordpress and I have been researching this for hours online and I'm not find a definitive or simple working example of how to achieve my goal. I need ...
0
votes
0answers
15 views

rewrite rule of post when accessed from archives pages

Im trying to rewrite the slug of the permalink of my post when accessed from my archives pages. at the moment it display like: www.mydomain.com/categorypost/post_title id like instead ...
0
votes
1answer
25 views

Multiple Custom Post Type permalink issue

I have 2 Custom Post Type(Our Works and Case Study) in a WordPress site. If I add same postname(Pepsi) at my 2 Custom Post Type(Our Works and Case Study) the permalink will show given below: 1) ...