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

$_POST empty in using new php file added to theme

I am using a theme which handles form data with jquery (a handler function defined).I have added a new php file to theme (using it in as template in a wordpress page, also registered with rewrite ...
0
votes
0answers
53 views

Rewrite Rules: Post ID within Post Slug for a Custom Post Type

I've got my custom post type slug article and I need the following permalink structure: http://domain.com/article/postname-123/ The number in the end has to be the post ID. I don't want /article/...
0
votes
0answers
17 views

rewrite rule added to function.php not work

Hello in my custom plugin i want to set custom rewrite rules. First i trying make this with one rule, so i create functions.php file in my plugin folder and i paste into this code: function ...
1
vote
1answer
2k 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
0answers
55 views

Add Rewrite Rule giving 404 Error

I'm having a little problem with Wordpress add_rewrite_rule function. I'm trying to accept a user subscription by using the URL from the email I've sent. The hash I use is generated from ...
0
votes
1answer
66 views

Mod_rewritte - remove ?m=1 from url

Previously, in blogger, desktops were seeing my posts at http://www.example.com/year/month/postname.html while mobiles were directed to an automatically created mobile version at http://www....
1
vote
1answer
42 views

Enpoint Not Found in Rewrite Tag Permalink

I'm trying to make an XML feed show nice and pretty permalinks rather than showing query strings. The problem is I can't get my /products/ endpoint to show up when trying to process my custom rewrite ...
0
votes
1answer
64 views

Add URL Rewrite Rule To Wordpress

my link http://localhost/abm/?ct_city=la-jolla&search-listings=true i want to this http://localhost/abm/USA/la-jolla Could you help please.. htpaccss file # BEGIN WordPress <IfModule ...
0
votes
1answer
23 views

How to disable wordpress page rewrite rule?

I am having a problem with some rewrite rules. I am using a plugin that makes requests like this: /pluginname?nonce=123456789&action=submit the problem with this is that my wp installation takes ...
0
votes
1answer
131 views

URL Change - Check if Post Exists Before 404

We had a custom CMS with URLs such as /adele, /slayer, /beastie-boys but now they have the structure /artist/adele, /artist/slayer, /artist/beastie-boys (a custom post type) Obviously when people ...
2
votes
2answers
2k 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 ...
1
vote
1answer
118 views

Rewrite Wordpress URL to show CPT meta field data

I'm stuck in need of a rewrite rule. I have set up a custom post type for 'Books', each book has a repeatable field (using ACF Pro) for chapters. I have added a query_var for chapter using the code ...
0
votes
2answers
57 views

Rewriting in wordpress url

Yes we love to make the url more shorter ,more clean. Lets say we have css url like this xxx.com/wp-content/theme_name/css/my_custom_css.css However i would love to display it like this xxx.com/...
1
vote
1answer
33 views

Rewrite and custom post type: order by custom field not working

I have a custom post type "placement" with a custom field "position". What I want to do is, on the placements archive page, to order results by the "position" value. I have the following URL rewrite ...
2
votes
1answer
67 views

Custom Permalink Tag breaks Pagination

Most the below work stems from a previous question / accepted answer. I'm trying to achieve the following permalink structure: /listings/ /listings/page/2/ /listings/%state%/ /listings/%state%/page/2/...
0
votes
0answers
62 views

Paging not working for hierarchical custom post type

I've defined a custom post type called Fishing Reports, and want to break it down by states, then regions. For example: url.com/fishing-reports/florida/northwest/ That part is working as expected. ...
0
votes
0answers
84 views

Connect custom rewrite rules and query variables to wordpress navigation

Setup for getting content My setup for getting custom content in Network of sites where many sites use the same custom data on the side of worpress generated content. Custom classes to get custom ...
1
vote
0answers
138 views

Multisite theme path rewrite using .htaccess

I'm trying to rewrite the theme path for multiple domains (wordpresss multisite) using separate themes, this is my current .htaccess file, this is allowing each site to use seperate CSS files but not ...
1
vote
1answer
102 views

WordPress rewrite rules for state and city

I'm building a site where every state and city in the US has a landing page. I have a database of every city, state, and zip code, set up as a custom post type in WP. Here's what I've done ...
1
vote
0answers
232 views

Add hierarchical taxonomy to permalink for custom post type

I've found various questions about this issue, and I still can't get this to work. I have a post type called "product" and a taxonomy called "type". I'd like the URL for a single product post to be: ...
0
votes
1answer
50 views

rewrites and custom links in page need help with add_rewrite_rule

I have one page with edited permalink, like, address.com/detail/ I need to send there some values by GET request, so i would like the link looks like /detail/value1/value2/ i added this code in ...
1
vote
3answers
571 views

I want to create a filter for the query string is this possible?

I have spent the last few days working on and researching this question and have found no solution. Basically I want to replace the query string which wordpress parses in order to query the database....
0
votes
1answer
200 views

htaccess and redirect to new url using regex

I have a hard time to create rewrite rule for a redirect using part of an old URL for WP. Example: Old URL: http://www.example.com/news/index.php/2014/11/07/my-blog-post-from-old-site or http://...
0
votes
0answers
17 views

Exclude word from url

On my wp site I have a couple of urls http://example.com/article/[page], I would like to exclude the 'article' part. How to best do this? I have tried creating a RewriteRule in .htaccess, but I ended ...
0
votes
1answer
58 views

Where is wordpress redirecting wp-admin/admin/dashboard to wp-admin and how to turn it off

I mean when we have subdirectory install and /wp-admin/ is not referencing to directory wp-admin, but wordpress stills redirects and not just for wp-admin slug but also for admin and dashboard and ...
0
votes
0answers
33 views

Mixed CPT permalink structure

Im working on a site and i would need to add new features to the The Event Calendar plugin. The plugin uses tribe_events for event CPT and tribe_events_cat for Event category taxonomy. I need ...
0
votes
1answer
110 views

add_rewrite_rule doesn't work for me

I'm trying to use add_rewrite_rule to make custom URL. My problem is the same as here : Custom Rewrite with Query vars But I tried the 2 solutions, and it doesn't work for me. For testing, I ...
0
votes
0answers
87 views

Rewrite permalinks for custom post type, meta key?

The site I am working on uses the following "pretty" permalink structure: http://example.com/watch/the-strain-eps3/ I want to change it to: http://example.com/watch/the-strain-eps3/1504 1504 is ...
1
vote
1answer
38 views

CPT custom archive template does not get loaded

I have a custom content type called events that I register using the following function: add_action('init', 'events_post_init'); function events_post_init() { register_post_type( 'events', ...
2
votes
1answer
5k 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', '...
0
votes
0answers
230 views

Get the custom post type slug but remove the rewrite prefix?

I am trying to add a link to the parent custom post archive page in the breadcrumbs. I can get the slug using this: <?php $post_type = get_post_type(); if ( $post_type ) { $post_type_data = ...
0
votes
0answers
108 views

Blog List Page 404 With Custom Post Type Rewriting to Blog Parent

There will be a lot of code blocks below, but here's the short version: On a site, I have a Resources custom post type, with a Resource Types taxonomy. The URL for a Resource Type post archive is: ...
1
vote
2answers
1k 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
83 views

Pagination appearing twice in URL after rewrite

For my site, I have a custom post type video set to appear at at the URL http://site.url/videos. It is paginated so that there are 24 videos per archive page. However, I am not using the single.php to ...
0
votes
0answers
266 views

How to get Slim framework routes to work?

Using the Slim Framework for a REST API to query post data in a custom plugin: // custom plugin file // code reworked from https://github.com/Botnary/wp-slim-framework @define('SLIM_BASE_PATH', '...
0
votes
0answers
45 views

How to make variables in custom page URL look like the permalink structure?

I am using wordpress and in that i am using permalinks post name but in project manager plugin on click of one of one project i get this url which i want to make user friendly as the name of the ...
2
votes
1answer
2k views

generate_rewrite_rules (action) vs add_rewrite_rule (function): which one is preferred?

I see these two methods can be used to create new custom rewrite rule, so under what situation which one is preferred? I suppose they are doing the same thing? I can either use: add_action( '...
0
votes
1answer
112 views

Multisite custom rewrite urls

On a multisite installation, which is running the Polylang plugin, I want to add a custom rewrite rule. Currently, my permalink structure is: http://host.com/sitename/language/pagename Now I want ...
0
votes
0answers
27 views

Rewrite rules are correct but ignored

I am trying to get the following URL to point to a particular WordPress page. URL/courses/computer-course/units/ needs to redirect to URL/units/ with coursename='computer-course' and page_id='228'. ...
0
votes
0answers
94 views

Rewrite rules lead to blank page

Using a child theme, with custom post type article, trying to call a file from functions folder inside the child theme main folder (child-theme/functions), using this code in the child theme functions....
0
votes
1answer
26 views

Custom Taxonomy and Rewrite URL

I'm fixing some custom templates. There is this custom taxonomies add_action( 'init', 'custom_taxonomies', 0 ); function custom_taxonomies() { register_taxonomy('news_category', 'stfp_news', array( ...
0
votes
0answers
22 views

URL rewriting, problem getting arguments

How can I get URL/courses/[course_name] to point to URL/index.php?page_id=127&course_name=[course_name]? The redirection works well but I can't access the course_name argument. In fact, the page ...
1
vote
1answer
79 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
18 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
36 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
20 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: example.com//resources/articles/page/...
0
votes
0answers
193 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 index.php?...
1
vote
1answer
39 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
23 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: /news/%...
1
vote
1answer
54 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 ...