Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [url-rewriting]

Refers to the process whereby an URL is manipulated to create what in WordPress is called a "pretty permalink"

0
votes
0answers
9 views

Pretty Permalinks with CTP and Taxonomies / Hierarchical

My Site has 2 Custom Post Types with a 2 Taxonomies. One taxonomy is “Location” which is 2 level / hierarchical (Country, City). My goal is to get our Post Types & Taxonomies in a SEO Pretty ...
0
votes
0answers
7 views

History API & URL for single long page

I'm working on a NON-API Wordpress site. One of the pages is a long page segmented into several sections. At the top of the page is a menu for most of the sections on the page. When a user lands on ...
0
votes
0answers
6 views

sUse same content for different languages with language in url

I have a post-type "inventory" that don't need translations. I have made a page-template and made pages for all languages in wordpress and assingned the inventory page template to it. So I have /en/...
0
votes
1answer
9 views

Removing specific word from URL to redirect correct url

I am struggling to my site URL as it containing automatically one word last of the URL like: http://www.example.com/post-url/example I tried to put in htaccess. RewriteRule ^example/(.*)$ /example/...
0
votes
1answer
18 views

Home page with Polylang redirects to other page

On my website : https://www.littleguestcollection.com/, the homepage is redirected to other page (this one : https://www.littleguestcollection.com/fr/hotels/lux-tamassa/). I have no idea what is the ...
0
votes
0answers
32 views

URL Rewrite 404

I've got the following ReWrite rule: add_rewrite_rule("details\/([a-zA-Z0-9_]+)\/.*", "detail/?id=$matches[1]", "top"); Which seems to be adding in the following to my .htaccess, which now looks ...
-1
votes
0answers
14 views

Permalink conflict

I have page "page-slug" and term "page-slug" of some taxonomy which included in custom post type permalinks. I have subpages of this page and i seeking way for keepeng both urls site.com/page-slug/...
0
votes
0answers
19 views

add_rewrite_tag broke permalinks that doesn't use that specific tag

I have a custom post type that I'd like to have a permalink slug based on its taxonomy. All the posts of this CPT have one, and only one, term always marked on this specific taxonomy. That's my code: ...
0
votes
0answers
20 views

Rewrite url for custom post type with specific url

I have a custom post types called Destinatiosn. These post on click opens as pages and they are organised hierarchically. Example: Malaga Food Gallery Rooms Marbella Food Gallery Rooms Now in ...
0
votes
0answers
31 views

WordPress custom post type url change

I have two custom post types. Destinations - destination custom post type has their posts and they are organized in hierarchical mode example: Malaga Food Gallery Rooms Marbella Food Gallery ...
0
votes
0answers
14 views

Prefix only some posts with a custom prefix

I'm lost in the world of Wordpress rewrites and I'm hoping someone can help... I'm creating two custom members areas from my site; users logged in as certain roles will be able to view certain posts, ...
0
votes
1answer
30 views

Dynamic CPT permalink structure based on ACF field value

There are already few questions on this topic but they are not helping my problem. So what I want to achieve is dynamic CPT permalink structure based on the ACF (radio) value. // _cb stands for ...
0
votes
0answers
31 views

Rewriting URLs - Adding a prefix to ALL site URLs?

I'm trying to add a prefix to all URLs of a WordPress site to be used as a language switch. For example: https://website.com/en/rest_of_url/. I've tried various ways to achieve this: manually adding ...
2
votes
1answer
25 views

Bulk 301 redirect for custom post type

I've amended the URLs for my custom post type from: url.com/jobs/job-name to url.com/jobs/job-location/job-name Problem is, because this isn't a standard rewrite wordpress doesn't do the 301 ...
0
votes
1answer
16 views

fixing page URL's

I've got this page to fix, however i'm quite new to WordPress, so i was wondering maybe anyone here will be able to help me. There's URL's in the header which should navigate you to pages like https:/...
0
votes
1answer
9 views

Wordpress index in subdirectory, blogposts in root directory

For our website we want to start a blog in the subdir domain.com/blog but for SEO value we would like the blogposts as domain.com/blogpost1.html . Is this possible in wordpress?
0
votes
1answer
25 views

How do I rewrite URL that has custom parameter

I'm stuck on rewriting my url. been searching for days hacking code together but to no avail - So looking for help now. My url is: https://domainname.com/topic/ux-process/?type=newsletter I want ...
0
votes
1answer
19 views

Wordpress drop domain alias

my client try to change domain without me and now, when you try to go into http://klenotnictvi-benesov.cz it will change into this site http://davidpros/ I can not change it in wordpress admin. So can ...
0
votes
0answers
16 views

How to modify archive pages URLs to include dynamic prefix?

I am building a website in WP where content (news, announcements, events) are grouped by regions (e.g london, nyc, ...; these are custom post types). In all the contents, I have a meta box where I can ...
0
votes
1answer
11 views

Help adding custom url, rewrite_rules_array

I'm trying to get a rewrite_rules_array rule to work and running into issues. I would like to add a rule so that when someone visits: http://domain.com/product/foo/bar It essentially loads: ...
0
votes
2answers
38 views

URL rewrite problem in WordPress plugin

I am having some trouble getting rewrite rules to work as I want in my a WordPress plugin. I added a rewrite rule: add_rewrite_rule('some_url','some_redirected_url', 'top'); The rule is written to ....
0
votes
1answer
25 views

Customise Permalink Structure For Custom Post Types

I've installed the Custom Post Types UI plugin and have made a post type and taxonomy. When I click 'add new' to make a new post the slug always defaults to:- https://domain.com/custom-post-type/post-...
0
votes
0answers
16 views

Custom post type parent page exclude sub pages

OK I will try to explain as best as I can. I have a wordpress site with the following page structure. /parent/sub-page-1/ What I want to do is attach a custom post type to the parent page which I ...
1
vote
1answer
19 views

add_rewrite_rule ignoring other params than the “p” param

A specific post on my website has a shortcode that uses a parameter called "query" to produce its content. So, this is an example of a working URL: https://example.com/my-post?query=980 "my-post" is ...
0
votes
0answers
26 views

Accessing Wordpress behind an Azure application Gateway

I am a complete novice at wordpress but have been called on to help on a project. They need to have 2 sites behind an Azure application gateway. We have a .net site developed in house and a wordpress ...
0
votes
0answers
12 views

How to use add_rewrite_rule() for multi custom post types for same URL structure

I am developing a project in WordPress where I have 2 custom post types book and movie. The owner of this website wants me to make URL structure like the following: Single book URL will be -> example....
0
votes
0answers
10 views

Wordpress URl rewrite only for pages with query parameter

I have a functionality on first page it lists all states on click of any states in next page it lists cities related to that state and on click f city it shows city page. State list page - https://...
0
votes
0answers
26 views

Custom post type structure + permalink structure

I need to create this structure: example.com/animals (with all animals classes) example.com/animals/classes (with all animals of this classes) example.com/animals/classes/animal_name (the animal's ...
0
votes
1answer
33 views

How do I know if a rewritten rule was applied?

I defined a custom post type with rewrite rule: register_post_type('balls', [ 'labels' => [ 'name' => 'balls', 'singular_name' => 'balls', '...
0
votes
3answers
58 views

How do I rewrite a single category link to point to a custom page?

I have categories Cats, Dogs and Rabbits. I would like to change the link used for "dogs" when listing category on the front end to a custom page instead of the category archive.
0
votes
1answer
45 views

Trouble with question mark in rewrite rule

The url I am trying to rewrite looks like this. root_domain/something/something-else/also-different-1030/?success=1289 With this rewrite rule I am trying to catch the url and direct it to the post ...
0
votes
0answers
33 views

How to create a Custom permalink structure with custom taxonomies and custom post types?

I have Custom Post Type name with tour. and custom taxonomy Location and Type. I want To permalink Look Like Type/Location/Postname.
1
vote
1answer
20 views

How to add rewrite rule to custom post type with parent in url with cpt ui?

I'm trying to create custom post types but i need the posts of custom post type to have the url along with parent category. Example for now i have custom post types science, tech, business. The url of ...
0
votes
0answers
14 views

Wordpress category URL ?cat=categoryName

I need to change my category structure like this: http://example.com?cat=categoryName but I have no idea how to do it. I have been searching for more than 3 hours but doesn't find any related ...
0
votes
1answer
45 views

copy attachments to another post type and change attachment url

On my site I have to custom post types and a function that let's users import photos from post type A to post type B, copying the meta values and it copy's the image to the folder specified for post ...
0
votes
1answer
14 views

Permalink misbehaving in Custom Post Types

I have a post type named careers which is, function do_careers() { register_post_type('Careers', array( 'labels' => array( 'name' => 'Careers', 'singular_name' => '...
1
vote
1answer
33 views

Custom post type as home page with custom url

I've changed the permalinks to add a string at the beginning of the url like this: /london/%postname%/ This works perfect for all the pages but not for my home page. I set my home page to be a single ...
0
votes
0answers
24 views

Set archive of custom post type like 'posts' page in reading settings is set

I'm starting development on a WordPress site soon. For a specific post type, they want the archive to be part of the page structure. For the default post type, you can set the archive to a static ...
1
vote
0answers
30 views

Alias 'wp-content' directory to something shorter (framework?)

I recall seeing this as a feature of a Wordpress Development Framework, so I know it's possible (can't remember the framework). I am interested in how to condense the Wordpress-generated urls to ...
0
votes
0answers
25 views

How to inject dynamic parameters into url pathinfo for all site content

Similar to this question here, but modified for my purposes: I want to inject into all urls of my website a country. For example: https://www.example.com/contact should be accessible by https://www....
0
votes
0answers
21 views

Routing for a post type archive with custom taxonomy as a url parameter

Essentially, I have a custom post type product and it uses a taxonomy product-categories. I currently have my routing configured to use the top level category as part of a product url, e.g products/...
0
votes
0answers
15 views

Remove child category from URL. I can not bring everything back

I deleted the child category using the hook: function wpse147453_remove_child_categories_from_permalinks( $category ) { while ( $category->parent ) { $category = get_term( $category-&...
0
votes
0answers
24 views

How create url rewrite for 3 different taxonomies in the same Custom Post Type

Hello I have a custom post type called "vehicles_cpt" to this are linked 3 taxonomias (year, make, model) I need to write a url like this https://localhost/2019/volvo/x7 redirect to the post that has ...
0
votes
1answer
47 views

How to change form action of wp-login page with a function

I'm manually creating my own Wordpress login form. The action parameter of all the forms points to wp-login.php. I want to change it for all of them to custom url (/login). Any idea how to that? For ...
0
votes
1answer
30 views

Removing CPT slug from URL results in 404 error for archive page

I have created a CPT with rewrite rules as follows: "rewrite" => array( "slug" => "/", "with_front" => false ), In the functions.php, I have added the following code: function ...
2
votes
1answer
41 views

Flush Rewrite Rules on init or rest_api_init?

if I'm using the REST API to create endpoints in my plugin, should I be flushing rewrite rules on init or in rest_api_init? I realize that it should be done on plugin activation/deactivation. However,...
1
vote
1answer
52 views

Taxonomy page returns 404 page not found

I have a custom post type and one custom taxonomy registered for it. The custom post type is called "memory-cards" and the taxonomy is "lesson".For this taxonomy I have create two terms "english" and ...
1
vote
1answer
55 views

Customize Custom Post Type URL

Actually I needs to change the structure of my urls for the custom post type ( I also want to customise taxonomy url but only targeting post for this question to avoid confusion) My custom post type ...
0
votes
0answers
27 views

rewrite slug with_front => false issue

Setup a custom permalink structure like this: /blog/%postname%/ It's working as expected with new registered post types set with a false 'with_front' but for some reason some post types also show up ...
0
votes
0answers
16 views

Register Taxonomy for Custom Post Type Tag page not working

I am using the 2017 theme with a custom post type Bookmark add_action( 'init', 'create_bookmarks_post_type' ); function create_bookmarks_post_type() { $labels = array( '...