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

1
vote
1answer
25 views

Am I using the flush_rewrite_rules function in the right place?

Hello dears I'm writing an admin panel for my new WordPress plugin base on the WordPress Settings APIs. I am defining a field for changing custom post slug from this admin panel. After the custom ...
0
votes
0answers
9 views

query var “p” empty on some requests | custom rewrite rules

I am moving a site from drupal to WordPress. The "nodes" on drupal have custom "permalinks" that don't follow any rules so I have added the permalinks as post meta and create a rewrite rule for every ...
1
vote
1answer
8 views

Default post tab showing twice in admin bar

I have to re-register WordPress default post type to change the post slug to "blog", changing permalink structure was not worked for me as it rewrite custom post types slugs also. So I used below code ...
0
votes
0answers
10 views

rewrite_rule - working fine but broken single post 404

I'm having an issue with my rewrite rule, works fine here: example.com/resources/ example.com/resources/articles/ Also works fine with the pagination here: ...
1
vote
1answer
28 views

Load an url with minimal/no DB queries

What would be an ok way to load a theme template with minimal/no db queries? Another question: is it viable to 'dry' load a non-wordpress template using rewrite rules? So instead of index.php?p=1011 ...
0
votes
0answers
48 views

Add custom parameter to permalinks

I have a WordPress page that I would like to use SEO friendly query parameters with. Let's say this wordpress page is accessible by going to http://www.example.com/test and its short URL is ...
0
votes
0answers
14 views

Can I use the same permalink base for Categories and Posts?

I am migrating our site from another CMS and the way the permalinks were setup with the prevous CMS are like this: posts: /news/%year%/%monthnum%/%day%/%postname%/ categories: ...
0
votes
1answer
13 views

flush rewrite rules doesn't flush them (still got 404)

So I tried to make a simple plugin for WordPress. Like a reviews. Even tried to do it through the tutorial of TutsPlus. Everytime I got 404 when tried. Then I just took the code from tutor and still ...
0
votes
1answer
33 views

Wordpress rewrite rules not working

I have created a plugin and i have gotten rewrite rules to work using my .htaccess file. I would like to make this work from my plugin instead to keep everything contained from within there. Im ...
1
vote
0answers
36 views

Wordpress Deadlock Error

I see more of this error these days in error_log. I see that someone asked this question here a year ago but no solution. Please advise what is causing this issue. Already, tried deactivating some ...
0
votes
0answers
10 views

What to do after a wrong RewriteRule?

I have A Wordpress MU and following this answer I changed my root .htaccess placing this before the Wordpress loop RewriteRule / /subfolder [R=301,L] trying to have a different homepage. It didn't ...
0
votes
0answers
32 views

Have a WordPress page with same title as custom post type “front” slug

I have a custom post type djs and a custom taxonomy city with two terms: boston and nyc. So a DJ can either be tagged as Boston or NYC. DJ profiles (a single djs post) are located at ...
1
vote
0answers
21 views

Rewrite rule for page with plugin shortcode

I created a plugin to display a list of real estate properties on a page. The list is embedded into a custom page as a shortcode: [real_estate_list status="1"] The list is loaded from an external ...
-1
votes
0answers
25 views

Rewrite Rules for Custom Post Type Taxonomy Archive by Date

I am looking t this page here and it works pretty well for standard taxonomy archive rewrites and custom post type date archives. Archive page for custom taxonomy grouped by month How would I make ...
0
votes
1answer
11 views

Rewrite rules ignored

Why are my rewrite rules being ignored by WordPress? I've got the following rule added: news/([0-9]{4})/?$ archive-news.php?year=$matches[1] but the URL news/2015 gives a 404. Why?
0
votes
0answers
6 views

Rewrite Rules and Archives

I have a URL that looks like this http://localhost/mysite/publications/2015/ and using the Rewrite Rules Inspector plugin released by WordPress I get the following 2 matches for that URL: ...
0
votes
1answer
26 views

Pagination for custom post types - url rewriting

I'm working with custom post type, that I want to paginate, here's part of code, initializing custom post type: $args = array( 'labels' => $labels, 'public' ...
1
vote
1answer
196 views

Regionalised Content

Ok, so - I am working on a magazine style website that requires "regionalised" content. So for example I have: UK (Includes ALL) Manchester Brighton London I have already successfully ...
0
votes
1answer
23 views

Custom Query & Rewritten URL Pagination 404

I have a custom search results page that has the url "/mysearch/location/SUBMITTED DATA/" which works perfectly fine. However I'm now trying to get my pagination working on that page so the URL will ...
0
votes
1answer
26 views

Rewritten URL not loading WordPress environment

I have a page that I am sending users directly to so I can serve them a PDF dynamically created using the FPDF library. Since I'm sending them directly to the file which generates the PDF, I'm ...
0
votes
1answer
26 views

Wordpress Prevent 404 on missing custom post

The thing I am trying to achieve is to get data from a third party data source and display each piece of information as if it was a "post" in a WP theme. Now, the WP theme intrinsically works with ...
0
votes
0answers
20 views

CPT Rewrite Rules by date

I'm having issues with date categorized posts for my CPT. I have permalinks not on the default. I created a CPT with register_post_type and setup rewrite rule as follows. 'rewrite' => array( ...
0
votes
1answer
41 views

htaccess doesn't cache my latest news when logout

To speed up my website i'm using w3 total cache and some htaccess . . . it works just amazingly ! Otherwise, big problem, I have on my homepage the latest news being display, when I'm login, it ...
0
votes
0answers
22 views

Stop WordPress from redirecting ?p= in custom rewrite rule to slug of page

I've written a custom rewrite rule, which should rewrite a specific case of a taxonomy url to serve a page. The rule is as follows: add_rewrite_tag('%tax_slug%', '([^&]+)'); ...
2
votes
1answer
24 views

Single Redirection Rule for Pages and Archive links

I am trying to find pretty URL solution for url parameters. Consider this url set http://example.com?token=foo http://example.com/pagename?token=foo http://example.com/parent/childpage?token=foo ...
0
votes
0answers
16 views

URL Structure for Custom Page Type with Custom Taxonomy

There are a number of questions here that are similar to what I'm trying to do, but none seem to answer what I'm looking for. I have a custom post type with a rewrite like: 'rewrite' => array( ...
0
votes
1answer
28 views

Custom taxonomy Rewrite Rule

I want my taxonomy url to be like this: site.com/page/taxonomy_term How will I be able to achieve this? I have written a wordpress rewrite rule code in my functions.php like this: function ...
0
votes
0answers
19 views

Added incorrect rewrite rule now getting an error

I have made a mistake using add_rewrite_rule() function and now my site is throwing a 500 "internal server error" normally I would just edit/fix the issue in my .htaccess but since this is not how ...
0
votes
0answers
7 views

WordPress Rewrite/Query Var .. ignore a word?

I have created an 'event listing' area on my WP website, it uses rewriting and a query var to dynamically load the event 'slug' as a variable so that I can add pages on the fly. However it has broken ...
0
votes
2answers
30 views

add_rewrite_rule isnt working, not getting added to rules array, why?

I'm trying to add a new rewrite rule but it doesn't seem to be getting added to the array and it certainly isn't working. I'm trying to get this URL, dult.dev/lists/games/destiny, to take me from a ...
0
votes
0answers
32 views

How can I map a specific URL pattern to a plugin for processing

I want to send traffic of a specific URL pattern to be processed by my plugin. Based on that pattern, I will pull some custom post type information from WP, gather external info via JSON, aggregate ...
0
votes
0answers
21 views

add_rewrite_rule working for posts but not for pagination

I have used add_rewrite_rule to change my urls please check the code below. add_rewrite_rule( '(.+?)/([^/]+)/?$', 'index.php?category_name=$matches[1]&name=$matches[2]&is_play=1', ...
0
votes
1answer
27 views

Capturing /page-name/[0-99999] in both template and number

Apologies if this has been answered already - I have singularly failed to word my question in a way that Google can help. I'm trying to create a page that acts as a base URL for a range of items with ...
0
votes
2answers
67 views

Custom Rewrite with Query vars

I have been stuck on this for hours and tried all these different methods but none seem to work. I've seen other threads with a similar problem but the solutions are not working for me. I'm hoping ...
0
votes
0answers
28 views

WordPress render's 404 for known rewrite rule

I have defined rewrite rule for my hieratical custom post type. remove_filter('template_redirect', 'redirect_canonical'); function add_artists_query_vars($aVars) { $aVars[] = "work_index"; ...
13
votes
1answer
332 views

How to reliably flush rewrite rules on multisite?

Let's say you have a plugin which need to flush rewrite rules. You do it all properly with activation hook and adding flush late, so everything is smooth and compatible. And then one fine day someone ...
0
votes
0answers
35 views

URL Rewrite Rules & Get Method

I have three dropdowns on my blog which allows you to filter by custom taxonomies. I'm using the following function to create the dropdowns: function get_terms_dropdown_risk_category($taxonomies, ...
0
votes
0answers
32 views

Get custom pretty-permalinks working with 3rd party API querystrings?

Edited to remove any reference to 3rd party API stuff: I have /%category%/%title%/ as my permalink structure. I have a page which uses a couple of querystring variables: ...
2
votes
1answer
135 views

How to add rewrite rules and pagination to retrieve attachments files?

I'm trying to list attachments based on different taxonomies. Right now it only work for the basic url (no pagination added). For example ...
0
votes
0answers
37 views

Changing default slug of post to the post id

Is it possible to change the default slug from the post title to a number? For example, the current url to a blog post would be: baseurl/blog/the-title-of-the-post Lets say the id of the post is ...
0
votes
0answers
16 views

WP Rewrite - some rewrite rules are ignored and instead a redirect is served

I am trying to allow any URI that's prefixed with pf/ to show a page without redirection. I do this by filtering rewrite_rules_array and simply duplicating the rules with a pf/ prefix public function ...
1
vote
1answer
49 views

How to building pretty URLs to reflect category hierarchy?

At the moment, this is how I access brands (custom post type) on my page: http://example.com/<base>/<brand> I would like to access brands like this: ...
0
votes
0answers
26 views

Wordpress add_rewrite_rule with priority

I'm working on a Wordpress website which shows companies in a city. The URL's are like www.address.com/new-york/. I've created a rewrite rule for this and it works but now i'm not able to visit any ...
0
votes
1answer
59 views

How to change the displayed URL?

I'd like URLs like this: http://example.com/root/branch/twig/ be rewritten and displayed to a URL like the one below: http://example.com/root/twig/ At the moment, the two URLs point to the same ...
1
vote
1answer
72 views

How to check if a rewrite rule exists

A common problem with rewrite rules added in a theme is that there is no obvious hook on which you can flush the rewrite rules. The problem is getting harder when you update a theme with new code that ...
0
votes
0answers
19 views

Need help with rewrite for an archive page under a specific category

I have two CPTs, cartoon-series and episodes. I have one taxonomy, cartoon-series which is used to link the two CPTs together (long story - other threads for a complex issue). I have rewrites that ...
0
votes
1answer
39 views

Need help with complex custom post type setup

I have three custom post types: cartoon-series, episodes, and special-features. Right now I have cartoon-series posts set to be post-parents of episodes and special-features posts. That's the only ...
0
votes
1answer
44 views

Custom Post Type won't Register

I'm hoping one of you WP gurus can spot what I am missing. I have a CPT that won't register for some reason. It' virtually identical to another CPT that is registered just fine. I have a custom post ...
0
votes
0answers
59 views

Pass tax_query variables in URL

I'm trying to create some URLs rewrite for my site, but now I'm stuck. I have this structure in my permalinks: example.com/%custom-type%/%category%/%postname% The full URL is already working: ...
0
votes
0answers
21 views

Rewrite for custom type and custom taxonomy

Hello I created a custom post type using the Types Plugin, this custom type has the slug menu, and my permalink structure looks like that: example.com/%custom-type%/%category%/%postname% ...