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
238 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 ...
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 ...
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) ...
1
vote
3answers
880 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( ...
1
vote
1answer
240 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(.*)$ ...
2
votes
2answers
2k views

Custom Post Type Permalink / Rewrite not working immediately

Hitting a brick wall with the following: I have: 1 custom post type called cpt_community 1 custom taxonomy called tax_community If I set 'rewrite' => true in my CPT registration, then ...
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
221 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 ...
1
vote
1answer
215 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 ...
5
votes
3answers
745 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 ...
11
votes
1answer
11k 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, ...
2
votes
1answer
362 views

When to call `add_rewrite_rule` for safety

I am starting to run into situations on projects where I am combining multiple plugins which all use add_rewrite_rule and flush_rewrite_rules at different points. As we all know, calling ...
0
votes
1answer
411 views

How to do make mysite.com/post-name/sub-post?

I have a small doubt and wonder if I could help. By adding a post, I have the permalink "http://www.mysite.com/post-name". I would like to know how to post a parent, for example, ...
6
votes
0answers
653 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', ...
0
votes
1answer
293 views

Keep requested/entered url with add_rewrite_rule

I've got url-rewriting partially working. I have this rule: ...
2
votes
1answer
776 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 ...
2
votes
2answers
853 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, ...
7
votes
3answers
1k views

Can't get a custom template taxonomy page to display

I've been trying to wade my way through learning the ins and outs of taxonomies and how to integrate them into themes and I've run into a pretty basic issue that I can't seem to figure out. I started ...
2
votes
1answer
698 views

Using %postname% tag with a Custom Permastruct creates 400 Bad Request Errors from the server

This is related to another question that I had asked earlier. I'm doing some rewrite code to create some custom permalinks for a custom post type. I think I'm getting it mostly working except I'm ...
0
votes
1answer
617 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 ...
3
votes
1answer
582 views

WordPress Network on IIS7/SQL Server - Rewrite Issues

I've just installed a fresh WordPress setup on Windows Server 2008 Web R2 (IIS7) with SQL Server Express and WordPress 3.1. I completed the install successfully and logged into the admin section to ...
8
votes
3answers
5k views

WordPress Rewrite Rules for Custom Post Type and Taxonomy

I have found this place to be a good source of information in the past through a lot of Googling for the problems I have run into. My question pertains to the verbose rewrite rules WordPress uses. I ...
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
270 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='); ...
0
votes
2answers
467 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
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 ...
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
487 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
128 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 ...
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
2answers
524 views

rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked

thanks to Roman for pointing me in the right direction my plugin is almost ready. The only problem i am now facing is that i cannot get the rewrite_rules applying on activation they only work after i ...
0
votes
1answer
296 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
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
817 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
1answer
539 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
493 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 ...
0
votes
1answer
430 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
132 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 ...
1
vote
2answers
807 views

Where do I USE add_rewrite_rule?

I need to add a RewriteRule to my site. I have tried in .htaccess with no luck, it doesn't get parsed, so I'm all but giving up on that. I found the documentation on add_rewrite_rule, but have no ...
0
votes
1answer
46 views

How to link to custom “archive like” page with custom permalink rules “dynamically”

I am working on a plugin where I am trying to create a "archive like" page with permalinks. Here is what I have so far: I've created a query var "experience" I've created custom SQL selects using - ...
1
vote
1answer
130 views

ReWrite rule for files of a previously standalone blog moved to network

A moved a standalone wordpress install to be one of a network, but the possibility to access the uploaded files with the same URL is need to be kept. I'm trying to get the following rewrite rule to ...
0
votes
1answer
542 views

HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?

Hi i am currently writing a WordPress plugin that i want to release to the public. I am having a few issues with URL rewrites however. I have got the plugin to redirect to the plugin page ...
2
votes
1answer
1k views

Prettified page URL w/ query var redirects to prettified page URL w/o query var

I have a page created (page ID 235) with a page template that will need to be passed a variable. I would like to pass this variable through the URL. My first attempt was to pass this with a GET ...
3
votes
1answer
253 views

Help with a TV series Rewrite structure

Not sure if this is possible, but bear with me. I think I am halfway there. First a little background: I'm using the build in hierarchy in WordPress to form relationships between post types. I ...
0
votes
2answers
362 views

how to properly rewrite url by custom var

ive been trying to rewrite a shop uri, and what i have now is this code: add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars'); ...
0
votes
3answers
807 views

Need to make a php file inside theme accessible via url

I checked this post here Making a plugin file accessible via url rewrite? which seems to have the same problem as me but its for a plugin. But so far i am getting 404. add_action( 'init', ...
4
votes
1answer
2k views

Querystring parameter getting lost in rewrite rule

I have successfully added a custom post type and the permalink structure works great. So, for instance, I've got a custom post type books, and the permalink to a book is /books/the-dictionary. My ...
3
votes
3answers
638 views

Plugin to Consume a Web Service

I'm attempting to write a knowledge base plugin to consume the Salesforce API and pull in solutions in a RESTful style application path; however, some of the core plugin concepts escape me. For ...