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
0answers
4 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
9 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) ...
0
votes
0answers
4 views

Internal Server Error (Subdomain Install) [on hold]

I have another Wordpress install on a subdomain on my server when i tried to go and install it i get a 500 Internal Server Error. On my root server under /public_html i have in .htaccess. # BEGIN ...
0
votes
1answer
24 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 ...
-1
votes
0answers
13 views

How to redirect special post type?

I have special post type. And it has weblink: http://example.com/our-post-type/id/items-number I need Wordpress open this page http://example.com/our-post-type/id instead for any items-number. ...
0
votes
1answer
20 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
19 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 ...
0
votes
1answer
21 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
20 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(); } ...
0
votes
1answer
40 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
56 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 ...
1
vote
0answers
38 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 ...
0
votes
1answer
22 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 ...
0
votes
0answers
29 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
1answer
12 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
27 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
12 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
27 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
18 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
20 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
13 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
20 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) ...
0
votes
0answers
12 views

Remove final slash from url

I created rewrite this rule: public function manage_user_routes() { add_rewrite_rule( '^user/([^/]+)?', 'index.php?control_action=$matches[1]', 'top' ); } but when I try to access ...
0
votes
0answers
50 views

add_rewrite_rule set up correctly, why does new URL show 404?

My aim is to have the following URL structure: /text-string/text-string/directory/text-string/text-string/1234/ point to page 447 with parts of the URL passed as get variables. (I am not worrying ...
2
votes
1answer
63 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
0answers
35 views

Custom post type slug rewrite blocks pagination - how to solve this?

I have run into a problem while doing what was given as a solution in the following thread: Remove Slug from Custom Post Type Namely, after all of this being done, my pagination no longer works. As ...
0
votes
0answers
29 views

rewriterule problem

I'm struggling to get a rewrite rule to work: I have a Wordpress 4.0 site sitting in a subfolder of a top domain with a url similar to this: ...
0
votes
1answer
53 views

Modifying rewrite rules to use <custom post type>/category/<custom taxonomy term>/

I know I can add a rewrite rule to accomplish this but I'd like to affect the links generated by WordPress (such as when I put a custom taxonomy term into a menu) I have spent the entire day today ...
0
votes
1answer
128 views

HTTPS to HTTP rewrite rules not working as expected

I'm struggling at getting these rewrite rules to work and was wondering if someone can point out my error(s). The following should redirect a user to HTTPS if they are at the login page or in the ...
0
votes
1answer
19 views

Remove rewrite endpoint on deactivation?

I'm using Milo's answer to add a Rewrite Endpoint as part of my plugin. Is there a straight-forward way to remove a Rewrite Rule upon deactivation? I found this snippet but I'd expect a ...
0
votes
0answers
19 views

How write rewrite rule to reroute tiny url?

I want to know how to write a regex : for exemple url: http://localhost/wordpress/post-title/lang/en become http://localhost/wordpress/post-title/en. I need a global rule for all types of posts? ...
0
votes
0answers
57 views

Clean/Pretty URLs in Wordpress Using Custom for Custom Variables ($_GET)

I have a Wordpress page that I am passing custom variables to; I was able to successfully get this page to accept the custom variables using the following: function add_query_vars($aVars) { $aVars[] ...
0
votes
1answer
12 views

Adding a custom rewrite rule for gallery/categories page

I've written a simple shortcode and using it on my gallery page. The URL for the page looks something like this: http://mysite.dev/gallery/?view=category-name but I want to be able to use ...
0
votes
0answers
13 views

Custom Rewrite Tag Structure

I am pondering over this intriguing question and I have yet to find an answer. I need to add my own Custom Structure Tags for my cpts. Extract fromt he link above: %year% The year of the post, ...
0
votes
0answers
42 views

Custom Post Types and rewrite rules - One CPT works and a cloned one doesn't

I have two Custom Post Types in my plugin and have a custom single-{cpt}.php file for each in my theme. Each page grabs the content from a specific wordpress post. The first 'house' post works but the ...
0
votes
0answers
73 views

Custom post type empty slug breaks permalinks for pages

In attempt to avoid posting a ticket to essentially reopen #15082 I'm posing here first. I have been vigorously dealing with this CPT permalink rewrite for countless hours now. After a 3am kinda night ...
0
votes
0answers
216 views

Archive page for a custom post type using WPML

On a website using WPML in last version, I have a Custom Post Type using an archive page, called archive-agenda.php. CPT is defined with this code : register_post_type('agenda', array( 'label' ...
1
vote
1answer
142 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
3answers
93 views

wrong template for page of archive

I am trying to add pagination to the archiveof my custom post type. Right now it is structured by year & month and I want to add pagination and I fail miserably. So its like this: <!-- ...
0
votes
0answers
23 views

Prevent guessing slug

I have the following rewrite rule function add_rewrite_rules($rules) { $new_rules = array( 'buscador-latte/(.*)/?$' => 'index.php?page_id=866&search_parameters=$matches[1]', ); ...
0
votes
0answers
29 views

Rewriting base name Taxonomy same Post Type

I have a Custom post type called "events" and taxonomy called "cat-events". I'd like this structure: website.com/events/ website.com/events/post-name (es: website.com/events/the-best-musical-2014) ...
0
votes
0answers
27 views

Custom Post Type rewrite permalink

I am trying to rewrite permalinks for my custom post type. The structure I look is: /%custom_post_type%/%custom_taxonomy%/%date%/%postname% Any ideas how can I achieve that?
0
votes
0answers
16 views

Rewrite Rule To Own File

Is it possible to add a rewrite rule to redirect to a page other than index.php? For example: add_rewrite_rule('([^/]*)/preview/?','preview.php?page_title=$matches[1]','top'); The above code only ...
1
vote
0answers
70 views

Rewrite rule for path of favicon.ico ( Add_rewrite_rule function possible ? )

Hi Wordpress developers ! I'm wondering, is it possible to make by PHP and power of Wordpress following: If user access http://localhost/favicon.ico, is it possible to make show user data from ...
0
votes
0answers
23 views

Wordpress internally rewrite rule challenge

Questions 1: I work on wordpress website for a client. But the client like to have a deep level url structure. The custom post type can be from level 1 to unlimited levels in the url structure. ...
0
votes
0answers
53 views

htaccess url rewrite within WP installation

I want to use one of my subdomains to rewrite urls and finally forward to an origin extern domain. Example: goto.mydomain.com/1saKCA3 -> externdomain.com/1saKCA3 I already tried to implement the ...
0
votes
0answers
11 views

Creating custom rewrite rules for site sections

I have a WordPress site with several custom post types. I would like to group them by a URL prefix. Maybe something like this: www.example.com/ prefix_one/ post_type_one/ ...
0
votes
2answers
96 views

Best way to redirect site in subdirectory to root?

I have a WP 4.0 site that has been installed at: mydomain.com/site It's been there for many years, so there are lots of links from around the web pointing to it. As part of an overhaul I am doing, ...
0
votes
1answer
39 views

How does WP determine the difference between a post and a page url

I'm trying to mimic WP routing in a javascript plugin. I've successfully imported the rewrite rules and am applying them to the browser location. But I can't seem to parse the difference between a ...