Questions tagged [url-rewriting]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
62 views

Redirect empty search to another page

I am using the following code to change the url of my search results page: function wpb_change_search_url() { if (is_search() && !empty($_GET['s'])) { wp_redirect(home_url("/suche/...
0
votes
0answers
15 views

../../page-name backend links are not rewritten

UPDATE: when selecting images in the media library, the view command leads to a wrong URL in the form of domain-name.com/image, though the actual URL is properly stored on the image details. On my ...
1
vote
0answers
16 views

"View post" leads to odd URL

On one of my sites, pressing "View post" from the back-end creates an odd URL, always taking the user to the homepage. The correct URL shows when you mouse-over the link - for example - www.trunk....
0
votes
1answer
40 views

How to add logged in username after WordPress URL?

I found a great solution for this issue in this article: How to add wordpress username after url? /* Plugin Name: My Awesome Button Description: The shortcode [my-awesome-button] will be replaced ...
1
vote
1answer
14 views

Change URL of posts and also Custom Post Type

Right now I have changed the posts url using the settings -> permalink i.e /blog/%postname%/ I have now added a CPT and using the rewrite 'rewrite' => array( 'slug' => 'custom-posts' ), but the ...
0
votes
1answer
39 views

Custom author url and page for another role

I would like to create a custom url and a separate or duplicate the author.php template for another custom role w/o using plugins. I found this related topic but it just modify the author url ...
0
votes
0answers
16 views

Add #primary at the end of navlink permalinks on single posts

I'm trying to add #primary at the end of the permalinks to the previous- and next post on all single post pages, to jump past the header directly to <div id="primary"> when going to the previous ...
0
votes
0answers
34 views

404 Rest Route not found - when serving behind "proxy"

To avoid CORS and speed up my static site, I have made a "proxy" from my static site. Basically, I can make a request to: staticsite.com/wp-json/some-endpoint and it fetch and return the response ...
0
votes
1answer
23 views

Dynamic URL with rewrite rule not working

I'm trying to update my link from this: https://dev.brunchwork.com/next-event/?eb_event_id=106098978902 To this: https://dev.brunchwork.com/next-event/[guest_name_here]/[event_id_here] Following this ...
0
votes
1answer
14 views

Current WordPress Page Title as Search Parameter into A Tag <a href=“www.domain.com/s?=currentpagetitle”></a>

i would like to include an affiliate link as a widget which inserts the title of the respective page as search parameter. <a href="www.amazon.com/s?=titleofthepage">Link</a> I have ...
2
votes
2answers
276 views

Add query string to url and display it as normal url part /folder/

I have a query string added to some urls which isn't pretty: ?city=Amsterdam So i'd like to structure the url like: https://example.com/realpage1/realpage2/amsterdam/ or https://example.com/...
1
vote
0answers
24 views

Wordpress author url to alias domain url? domain.com/author/{username}/

It's possible to create alias domain automatically for new authors? Currently, the author profile URL is -> example.com/author/username I'm using ISPCONFIG 3 as control panel What do I have to do to ...
0
votes
1answer
26 views

How can I access to the same post-type “page” from multiple different urls?

I'm developing a Wordpress website, and I have a problem with permalinks. I need to deal with following situations: http://domain/center1/ -> rewrite to "template_home_page" ( which has a different ...
0
votes
1answer
14 views

Need help with regex

I have this definiton to add a query var: add_filter( 'query_vars', 'add_reg_query_vars', 10, 1 ); function add_reg_query_vars($vars) { $vars[] = 'seminar'; // return $vars; } and this ...
0
votes
0answers
40 views

i want to change URL of WordPress image or rewrite in runtime

this my images url and I want to change( https://oneclickwebsites.co to https://oneclickwebsites.site) https://oneclickwebsites.co/0373990752233591/wp-content/uploads/sites/489/2019/11/image-from-...
0
votes
1answer
111 views

Route subpage to Custom Post Type

I have an artists-single.php page template which shows when I navigate to: /artists/djave_co Is there a way to route /artists/djave_co/anything to the same artists-single.php page? Then I can use ...
1
vote
0answers
34 views

A clean custom rewrite rule for weekly archives

Weekly archives are nearly undocumented, but WordPress can produce them, which I want. Good. But the URLs are ugly, eg. http://example.com/?m=2020&w=18 This gets partially rewritten to /2020/?w=...
0
votes
1answer
251 views

Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin

I developed a custom plugin for a site that is using URL rewriting within WordPress to create several dynamic pages. When one of these custom pages is loaded, I'm using the following functions and ...
1
vote
2answers
61 views

Redirect HTTP to HTTPS for all sub domains (blog posts)

I have a Wordpress site functioning as a blog site on a website. The main website is just basic HTML it is only www.example.com/blog which has the WordPress site. I have installed an SSL certificate ...
0
votes
0answers
45 views

Multiple URL rewrite rules and get every prams

I am creating a messaging system where I have 4 sections (1)inbox (2)sent (3)draft (4)unread so I decide to go with WordPress add rewrite rules I have already added one rewrite rule section. ...
1
vote
0answers
23 views

How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?

I am working on a test. Where i want the follow to be able to work: https://1587469162.webton.dev/referenties/ = page https://1587469162.webton.dev/referenties/hoofdcategorie/ = main taxonomy https://...
1
vote
1answer
614 views

Rewrite Rules to custom template

At the moment I have the following: a custom template: my_custom_template.php where the function below is called. <?php $uni_data = get_uni_data() ?> a page: www.website.com/my_page which ...
1
vote
1answer
582 views

Rewrite URL for only archive page (custom post type)

There is a few Q/A about custom post URL rewrite but I haven't found any simple answer to what I'm trying to achieve. My CTP is "event" and I have the current page structure that I want to preserve: ...
1
vote
0answers
27 views

Custom rewrite url category

I'm trying to add custom rewrite rule for my custom post type. What I want is that www.domain.com/erlebnisse show all posts (that works). Also I want that www.domain.com/erlebnisse/category shows all ...
1
vote
1answer
1k views

How to rewrite URL with PHP variables with htaccess to a normal looking URL?

I want to change an old database website that is not made in WordPress to WordPress. My site uses PHP variables so the URL is originally: example.com/index.php?tl=1&pg=2&bs=3&hcbs=4&...
1
vote
2answers
53 views

Get url param no longer works when using add_rewrite_rule

I'm using WordPress admin to create a page (named get-region-page), in which Pod shortcode is used to retrieve the URL parameter. For example: [pods name="region" slug="{@get.regionparam}" field="...
1
vote
0answers
38 views

Rewrite Question Mark in Post Template to Make it Pretty URL

I hope you all are doing well and staying safe during these times. I was wondering if someone can help me figure out how to remove the question mark (?) in the URL. The URL I am trying to rewrite ...
1
vote
0answers
62 views

Right url for custom post type

I have custom post type called news2, and its url is land/news2. The archive page url is working well but how can I set my taxonomy page and single page right // Change custom post type permalinks ...
1
vote
1answer
78 views

How to overwrite registered taxonomy url from vendor plugin in child theme

In a vendor plugin I got this : register_taxonomy( 'listing-region', 'listing', array( 'rewrite' => false, 'hierarchical' => true, 'label' => __( 'Regions', 'bt_plugin' ), '...
1
vote
0answers
84 views

Add prefix to page URL based on the page template

I want to add a prefix to page URLs based on the page template and update also permalinks in the pages. Current URL: www.example.com/chicago Expected result: www.example.com/m/chicago This rule ...
1
vote
1answer
54 views

Preserve old website URL structure after migrating to Wordpress

Old (non-Wordpress) URL structure: "News" and "Gossip" are categories "Italy" and "Uk" are subcategories https://example.com/news/italy https://example.com/news/uk https://example.com/gossip/italy ...
0
votes
1answer
116 views

Woocommerce product rewrite rules not working

I am trying to change the default structure of the woocommerce product url to include the author username. The default url for woocommerce products in my installation is as so: https://<site_url&...
0
votes
1answer
141 views

Custom account page that accepts a query parameter

I am trying to add a new account submenu page that takes a query parameter. I have the following which works: add_action('init', function() { add_rewrite_endpoint('scheduled-order-create', ...
0
votes
1answer
209 views

Rewrite Rules are Redirecting

Trying to get a custom rewrite going for a page. Page Slug: /near-me/ Create Redirect: /near-me/STATE/city/ Even after flushing the permalinks. //* Add Rewrite Rule add_action('init', '...
0
votes
1answer
25 views

How to map domains to specific pages in WordPress and display them in the address bar?

I would like to have the following setup but don't quite know how to do it in cPanel or use WordPress MultiSite or both? www.maindomain.co.uk - with a wordpress install at www.maindomain.co.uk www....
0
votes
1answer
173 views

Permalink not changing according to post type

I am using two post types: a) Posts ( Default post type) also name as blog for blogging. b) case studies ( Custom Post Type ) only for case studies. I want to add the string ‘blog’ for default post ...
1
vote
0answers
20 views

I want to add a new tag to Wordpress URL permastruct

I installed a TV SHOW plugin on my WordPress install. URLs are like this: https://www.mywebsite.com/tv-show/title-of-tvshow Now I would like to add a specific tag to redirect the user to the right ...
0
votes
0answers
34 views

How to allow a variable with "/" in wordpress url

I use an API to get a list of jobs. I have created 3 templates. The 1st shows the list of jobs, the 2nd the details of the job selected and the 3rd a form. To create the URL for the form I must use a ...
0
votes
2answers
440 views

On a Https site, Css and Js Url are back to http after redirect the site

I have a website: https://media.example.com/blog/ And I want to change into: https://www.example.com/blog/ I made this transformation in the Wp-DB on the table wp_options, i modified the fields: ...
0
votes
1answer
117 views

How to remove parent category from child category url using wordpress rewrite rule?

I am trying to remove parent category from the child category but nothing happens. I have a website made with the use of EDD. currently i have categories like below: angular-templates react-...
0
votes
0answers
15 views

Wordpress network, add extra directory to subsite urls

I'm currently developing a multisite but I can't figure out how to solve this without adding another WordPress installation. What I want: www.domain.com = main site www.domain.com/events = page on ...
0
votes
1answer
535 views

Rewrite custom post & taxonomy to share same URL path

I have a custom taxonomy (video-category) for a custom post type (video), and I'm trying to rewrite their paths in line with the examples below: Post (Archive): about-us/video-center/category-name ...
1
vote
0answers
19 views

How can achieve this permalink perfectly? domain.com/%category%/%post-name%

I want to make a custom post URL like domain.com/%category%/%post-name% and I am able to do it but the problem is, the pages, posts showing 404. I registered a custom post named download with array('...
0
votes
0answers
32 views

How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?

I have a website structure in which I have created a custom-taxonomy(topic). Whenever a custom-taxonomy-term is created say "1", its three verbs a,b,c are created and they have their templates of ...
2
votes
2answers
666 views

Change links automatically to affiliate links

My goal: I want external links to shops I'm affiliated with (for example amazon) to automatically get the affiliate ID attached to it. Example: link I put in my blog post editor https://www.amazon....
0
votes
0answers
214 views

Translatepress taxonomy and custom post type root FIX

I'm using Translatepress. Great plugin, one exception: they haven't developed translation for taxonomies and custom post type root slugs. Does anyone know how to achieve this? Some .htaccess magic ...
1
vote
0answers
104 views

Custom rewrite rules not working with WPML

I have custom rewrite rules for posts on a WordPress website. The website is in french and I just added WPML to make it available also in english. WPML is configured to use directories (/en) for ...
0
votes
1answer
70 views

Order custom post type posts by custom field with pretty URL

I have a custom post type, let's call it my_post_type It has an archive at /my_post_type/ I'd like to create a pretty URL that behaves like the archive page, but orders these posts by a custom field ...
0
votes
0answers
11 views

How can I add a vanity URL for admin-ajax.php Calls?

Background I'm using the admin-ajax tool in WordPress to build a file generator. I have everything working, except that the current URL is ugly. I'd like to add a vanity URL that looks cleaner. My ...
0
votes
1answer
79 views

Using a template file for a specific custom URL

I was trying to use a custom URL to load a page template for single-events.php without rewriting the default URL format. I am using filter template_include to load the template like this: add_filter('...

1
3 4
5
6 7
40