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
189 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 ...
0
votes
1answer
39 views

rewriting for custom taxonomy rewrite

I want to rewrite my custom taxonomy in form of http://mywebsite.com/cars/my-tax All examples i found makes use rewrites and use a new function to get the new permalink... problem is normally to get ...
0
votes
3answers
66 views

How to flush rewrite rules on the activation of any plugin

I created a function in functions.php that adds some rewrite rules: function add_rewrite_rules() { add_rewrite_rule('events/page/([0-9])*/?', 'index.php?pagename=events&paged=$matches[1]', ...
0
votes
1answer
42 views

Custom URL scheme - paramters on custom post type

I have a custom post type set up as Event. Within this post type I have various bit's of content / custom meta which will be used on two or three different pages. I was wondering lets say I had my ...
0
votes
0answers
35 views

Unable to manipulate rewrite rules without calling flush_rewrite_rules() each time

I am trying to make a small portfolio website in multiple languages. Just a few pages (the actual blog doesn't need to be in multiple languages), mainly pages that are generated by a own-made plugin. ...
0
votes
0answers
36 views

Permalink clashing with Custom Post Type rewrite rule

I have created a custom post type called 'members' which works correctly. I have set the rewrite rule to... 'rewrite' => array('slug' => 'our-members'), I have then added some items to this ...
0
votes
0answers
190 views

Nginx rules for multi-site with fixed alias slugs

I had a working WP 3.5 site on apache2. We're moving to a new server and using Nginx. I have updated the files to WP 3.9 (latest current). Accessing /wordpress/ directly lets me see the master ...
0
votes
1answer
76 views

WordPress site displaying 404 for any page apart from index

My WordPress site is returning a 404 not found error on any page apart from the homepage and /wp-admin. I have no absolutely no idea why this is. My Permalinks are set up to use ...
0
votes
1answer
48 views

Sort loop with query in the link

I want to add some buttons that will sort the post by name asc/desc etc. I want to use query in the link like this http://domain.tld/?orderby=name&order=asc Is this safe to use? Are there ...
2
votes
1answer
319 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*)$'] = ...
1
vote
1answer
564 views

How to add custom rewrite rule to .htaccess?

I want to add a custom rewrite rule to my .htaccess file using a function inside functions.php The rewrite rule I want to add is as follows: RedirectMatch 301 ^/author/(.+)$ http://name-blog.com/$1 ...
1
vote
1answer
40 views

Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?

I am using custom urls for my author pages like this: http://site.com/author_name After I create a new user, that author page appears as not found; however, if I update my permalink structure from ...
0
votes
0answers
89 views

ReWrite Permalink to New Permalink Nginx

I used to have /%postname%/ permalink but something odd happened today, all links that I click suddenly redirect to home. So I changed the Permalink to /%category%/%postname%/ but this is a big ...
0
votes
0answers
15 views

Custom Taxonomy rewrite url

How to redirect a url from example.com/taxonomy/taxvalue/?spost=holiday to example.com/index.php?post_type=holiday&taxnomy=taxvalue Code: function custom_post_rewrite_rules( $rules ) { ...
2
votes
1answer
198 views

Add specific word to default page permalink

Right now I am working on one of my client's project. Its all about amazon product display. My client wants me to change the permalinks of all posts, pages, serch results, archive pages, ...
1
vote
1answer
49 views

Performance impact of rewriting WordPress URLs

I'm currently rewriting author URLs in WordPress. I've removed the author base slug /author/. Please note I have total control over page slugs so can guarantee there will be no conflicts. I've added ...
0
votes
1answer
26 views

Rewrite rules causing hole

I am using rewrite rules to catch /events/date/* Events is the custom post type I am working with. So archive-events.php, is normally my index, but with my rewrite rules, I need to identify a ...
0
votes
1answer
113 views

Getting add_rewrite_rule and add_rewrite_tag to work

I am new to using add_rewrite_rule and add_rewrite_tag. I am trying to get a very basic example to work, but nothing I do seems to make it work. I want to access this URL (this works when entering ...
1
vote
1answer
63 views

Custom rewrite_rules - only pass numbers and not alphabetic characters

I'm trying to add a rewrite rule to pass a var to a custom page template. For some weird reason it only excepts numbers in the variables, when I type in characters other then number it directs to ...
0
votes
1answer
41 views

Is it possible to rewrite a page url Without setting the permalinks to Post Name?

Is it possible to rewrite the page url if your page link is for example localhost/wordpress/?p=123 ? Instead of post_name.php?.... (So the first option of permalinks and not post_name.
0
votes
0answers
53 views

Child page Custom post type return 404

I have a custom post type with this structure parent/child-1/child-2-of-child-1/child-3-of-child-2/ All child return 404 error. My CPT settings are: $rewrite = array( 'slug' ...
0
votes
0answers
26 views

How to add rewrite rules adjust to permalink structure

I want to create an Archive Widget for Custom Post Type (product). I let my client to change permalink structure by himself. So, my question is: how to add rewrite rules adjust to permalink ...
0
votes
1answer
72 views

force_ssl_admin() causing issues with preview links

I have recently enabled my WordPress website to use an SSL Cert for administration/login pages. I am using the plugin W3 Total Cache with my Content Delivery network. I have noticed that when I am ...
1
vote
1answer
574 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
0answers
53 views

Custom URL in Wordpress with add_rewrite_rules and add_rewrite_endpoints

I have the following URL for a filter functionality that i try to build in wordpress: example.com/offers-type-all-inclusive-from-germany-transportation-airplane.html How can I make the arguments ...
1
vote
1answer
45 views

Rewrite Rules returning wrong data

I have a custom post type called product. It is categorized with the two taxonomies product_category (which is superior) and product_group. I want the permalinks for single products to appear like: ...
0
votes
1answer
74 views

Passing variables in the permalink structure on a custom post type

I have a structure like this for my custom post types: domain.com/member/member-name/book/book-name Basically, I have a custom post type of member, and the member-name is the post. What I want to do ...
0
votes
0answers
255 views

Multisite sub-directories IIS 7.5 change media/uploads location

I am running WP 3.8.1 Multisite. Sub-directories is configured. I have 10 sub-directory sites and 1 primary site. WordPress is running on a Windows 2008 R2 datacenter 64bit server with IIS 7.5. I have ...
0
votes
0answers
54 views

Custom Rewrite Rule with Sub Folders

I need to create a custom rewrite rule for a WordPress plugin. I have read this topic and came up with a working solution using add_rewrite_rule(). However, after testing the plugin, I realized that ...
0
votes
0answers
75 views

Page displaying but the inspector shows 500 Internal Server error?

I have setup custom urls for a wordpress based site, (not using wordpress pages or posts) but custom urls and including custom page templates. I have several urls working fine except one, page ...
0
votes
0answers
28 views

Create custom page from custom rewrite

I want to know how to create a custom page with a custom URL route, but I only found how to define a custom URL and custom route (rewrite URL) to any post-type. The problem is that I don't want a ...
0
votes
0answers
50 views

get_permalink is getting old rewrite rule

I had some rewrite rules in my functions.php file. I decided that I didn't need them, and removed all rewrite rules and then flushed them. However for some reason when I use get_permalink() the url is ...
0
votes
2answers
326 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
351 views

Parent cpt/child custom post type URL permalink relationship

I am attempting to set up a relationship in Wordpress between two custom post types I’ve created and display that relationship within each post type’s permalink URL structure. I have created two ...
0
votes
1answer
50 views

Custom post type rewrite with_front

What I'm setting up, I thought would be quite simple. In fact, I'm sort of amazed that the answer didn't just pop up after a half hour of searching here. Here is the code to create my CPT: ...
0
votes
1answer
75 views

Apache rewrite rules and wordpress problem

I tried to fix my problem by using wordpress rewrite rules but sadly it took me so long I tried this approach. I got it working for one of my simpler problems but now I can't get it to work for my two ...
0
votes
1answer
85 views

Wordpress URL rewrite problem

blog.com/product/somename In the above URL - how do I tell Wordpress that 'product' is a variable and 'somename' is its value. Then how do I extract that value and use it inside a function I'll ...
-1
votes
1answer
27 views

Why do I need to register my custom post type a second time when flushing rewrite rules?

If I register my custom post type when the init action fires (which is before plugin activation) why do I need to register my custom post type a second time when flushing rewrite rules (on plugin ...
0
votes
0answers
45 views

Permalink broken for pages after adding rewrite rule

After adding these rewrite rules: add_rewrite_rule( '([^/]+)/page/([0-9]{1,})?$', 'index.php?author_name=$matches[1]&paged=$matches[2]', 'top' ); add_rewrite_rule( '([^/]+)?$', ...
1
vote
1answer
92 views

flush_rewrite_rules() cancels the effect of add_rewrite_rule()

As one of my plugin's features, I'm trying to define a custom url structure, like http://www.mysite.tld/foo/{action}. I'm using add_rewrite_rule() along with flush_rewrite_rules() on plugin ...
1
vote
1answer
145 views

Migration from old CMS to WordPress 301 redirection rules?

I need 301 redirection rule for migrating old CMS to WordPress. On old CMS I have URL structure like this: I wish is to move my site to WordPress and to have all old (or most) URLs with 301 redirect ...
1
vote
0answers
84 views

WP Rewrite the last two parts of the URL

I have found quite a lot of post on the subject of WP rewrite but I can't find the right words to describe this problem. I'm trying to accomplish the following: ...
0
votes
0answers
13 views

Rewrite rules for changing a custom page permalink with author details

I have the following page with permalink: http://mysite.com/custom_page/custom_var/author_name and I want it like this: http://mysite.com/author_name/custom_page The custom page conatins some ...
0
votes
0answers
79 views

Learning rewrite rules and custom permalinks. Paging not working

I am just starting to learn rewrite rules and custom wordpress permalinks. I have made a custom endpoint called autor with the following code: function my_query_vars($vars) { $vars[] = "autor"; ...
0
votes
0answers
221 views

Rewriting custom post type permalinks gives 404

I am using this code in my functions file to be able to include a post ID in my permalinks for a custom post type. But I am getting a 404 error when I attempt to preview view any of the posts of that ...
0
votes
0answers
39 views

WP_rewrite static Page URLs

Just moved over from blogger to wordpress. To try and maintain old URLs, and respective comments etc I've changed the site URL in the wordpress settings to match the old blogger format which was ...
0
votes
0answers
208 views

add_rewrite_rule not working in Wordpress Multisite

I need to rewrite urls on a Wordpress Network/Multisite, so I wrote a plugin that does it for me. This plugin works perfectly when using on a Single Wordpress site that does not make use of the ...
1
vote
1answer
31 views

How to always rewrite author archive page URL even if the author does not have a post

My understanding about author archive page URL rewriting is that as long as the author has atleast one post/page the URL for the archive page ofthe author will be re-written to: ...
0
votes
0answers
131 views

flush_rewrite_rules vs $wp_rewrite->flush_rules

I have been trying to flush the rewrite rules whenever admin chooses to change some value which needs rewriting. I first tried flush_rewrite_rules(true)(hard flush) which didn't work. Then I tried ...
0
votes
1answer
56 views

How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?

Using the below hooks, I tried to rewrite the permalinks of my custom post type magazine_issue to be made of values of additional meta-fields I added to the edit screen. The problem with my actual ...