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

Change cannonical URL after changing url with add_rewrite_rule()

So, I'm making a plugin for some niche application for my customer which involves a table with data, and I created a page within the plugin to show more in-depth information about the table row. This ...
0
votes
0answers
7 views

Add custom segment client name in WordPress URL

I have a saas application backend in CI and frontend in WordPress.In WordPress based on saas client, I will show custom contain like about us contain and other details but all clients share same ...
0
votes
0answers
11 views

How can I make rewrite rules for a custom post type?

I'm trying to create rewrite rule which will work this way: when user enters URL site.com/projects/projectname/cityname it should work as site.com/?projects=projectname&city=cityname, where: ...
0
votes
0answers
9 views

Disable WordPress from changing URL slug when post is published

We have post titles that contain emojis. While creating a post and saving it as a draft, the URL slug generated by WordPress doesn't add the [emoji] from the title. However, when the post is published,...
0
votes
1answer
13 views

Getting back a permalink from custom url

okay i have made my own rewrite rule, with the add_rewrite_rule function in wordpress to get a custom url, for an plugin page. add_action( 'init', function() { add_rewrite_rule( 'login/?$', 'index....
0
votes
0answers
10 views

Why did my registered rewrite rules get deleted?

I'm using this code to register a rewrite rule: class Affiliate_Link_Utils_Redirector { public static function install() { add_filter('rewrite_rules_array', array(__CLASS__, '...
0
votes
0answers
18 views

Similar URL structure for default post type (/article/postname/) and custom post type (/article/taxonomy/postname) breaks post links

I'd like to use two similar URL structures for the default 'post' type and a custom post type, the latter including a custom taxonomy (for language): 'post' permalink structure is: article/%postname% ...
0
votes
0answers
15 views

Custom Post Types and Custom Taxonomy URL structure

I have a site where I created a custom post type "Products" and custom taxonomy of "Product Type" with options like "Paint" "Primer" "Pumps" etc. I ...
1
vote
1answer
35 views

Can't get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together

Problem specification I'm implementing a website that is meant to host podcast shownotes and transcripts, and so I want custom permalinks and shortlinks for the webpages: Permalinks of the form /...
4
votes
2answers
58 views

How to change default page slug?

I have a CPT called jobs and a page named Job Apply. I am trying to achieve something like below url: http://example.com/job-slug/apply Where, job-slug can be any job. i.e Programmer, Developer etc.. ...
0
votes
0answers
32 views

Custom taxonomy shared across two custom post types - url rewrites

I'm using CPT-UI to create my custom post types and taxonomies. I have two post types - aulocations and uklocations these work and show up as: /au/locations/{location-names} /uk/locations/{location-...
-2
votes
0answers
20 views

When typing in url/xyz it provides a close match, ensure it only returns the exxact match url?

MY site seems to be giving the nearest neighbor return when you type in a url. Can I prevent this? Example myurl.com/Manny - I type this in and if there is no page called "Manny" then it ...
0
votes
0answers
17 views

Custom Post type with custom taxonmy (category) and custom tag write rules

I need help to create a rewrite rule for my custom taxonomy (resource category) and custom tag (resource tag). My custom post type is this: Resource - custom post type Resource type - Custom ...
0
votes
1answer
17 views

Name page template properly

I have custom taxonomy in place which builds URL that way: domain/course/course-name/lesson Course - is a custom post type. I am facing difficulty to reach the right template for lessons. I've tried &...
0
votes
0answers
10 views

Wordpress RSS feed image url replace string from raw url to CDN url

I have a Wordpress website that uses Cloudflare and Mailchimp. On Cloudflare I have scrape shield and hotlink protection activated. The Mailchimp campaign uses the Wordpress site RSS to automate a ...
0
votes
0answers
8 views

Exclude image from cloudflare hotlink protection

I am want to exclude my newsletter images from Cloudflare's hotlink protection Based on Cloudflare's documentation, it is possible to do this with serving the image from a "hotlink-ok" ...
1
vote
0answers
58 views

Help with Rewrite Rule for Custom Post Type with Query String

I'm trying to get a custom rewrite working: I've got the following URL pattern for a custom post type of 'product': /au/product/product-name-one/?type=customtype1 /au/product/product-name-one/?type=...
1
vote
1answer
28 views

Remove special characters in a URL

I need a help to prevent special characters in URL & it should redirect to 404 error page, if anyone specifically entered characters. I tried a couple of ways through .htaccess but none of them ...
0
votes
0answers
78 views

How do I get the correct URL?

Helo, WordPress Community! Help me, please. Created a custom post type with one taxonomy added as a category. Overwrite rules have also been created to display the complete structure of the CNC, for ...
0
votes
0answers
9 views

Rewrite destination url based on the origin url

I am trying to set up a proper translation system for my website and I have an issue that for dynamic pages the language reverts to default (even though the translation exists). I have three languages:...
1
vote
0answers
22 views

Rewrite URLs - Custom Post Type - Post Slug, Taxonamy Slug

Am using a third-party plugin for listing schools. Custom Post Type = school Custom Post Taxonomy 1 = school_type (eg. values = Primary, Intermediate) Custom Post Taxonomy 2 = school_location (eg. ...
1
vote
1answer
60 views

Not able to rewrite the pagination URL for the posts

My posts pagination in not working in WordPress 5.5 and So, I want to rewrite the URL for the pagination. I am using posts with pagination in the inner page with slug "post". Current URL (...
1
vote
0answers
31 views

wordpress admin ajax url rename

I came across this topic : How can I rename the WordPress AJAX URL? on trying to rename the url for the admin ajax.php file. I tried the code suggested by Krzysiek Dróżdż which is this // This will ...
3
votes
0answers
52 views

Taking a value from PHP_URL_PATH won't work after WordPress 5.5 update

A custom WordPress module takes certain int variable directly from the PHP_URL_PATH roughly like this: private function myIdVariable() { $myid = 0; // Support both URL formats: /path/123 and /...
0
votes
0answers
31 views

How to customize the Lost Password URL?

I have a WordPress website on which I have changed the default login url from “mydomain.com/wp-login.php” to “mydomain.com/login”. Currently my lost password URL is at “mydomain.com/login?action=’...
1
vote
2answers
41 views

URL Rewriting for PHP script on an image URL

I built an image randomizer so that when I open a .php file in a URL that it displays the image with readfile($randomImage);. This works locally but when I upload it to the server it gets blocked by ...
0
votes
2answers
58 views

Woocommerce different URL for every table placed in the restaurant

my company is working with different restaurants to digitize their menus so that people dont touch the menu cards in this Covid 19 pandemic, so every table in a restaurant will have a unique qr placed ...
0
votes
1answer
96 views

Pagination custom post type not working with rewrite slug

I can't find the way of making my pagination to work on my post type (this is not on an archive-posttype.php). I've rewrited my post type, but the second page isn't working if I do the rewriting (&...
1
vote
2answers
27 views

Create Dynamic SEO Friendly URL for Virtual Page

I have a Wordpress site that is built to be a job listing board, and I'm looking to create SEO friendly URLs based on data that is stored in the database. The URL structure should include the state ...
0
votes
2answers
54 views

After creating Custom post type by user delete old one

I have created a form where users update their profile. When a profile is created or updated it creates a CPT called course. The url is the permalink + /course/ + the title of the course /* CREATING ...
0
votes
0answers
16 views

How to rewrite rule and change product url to categories and product name?

Will really appreciate your help on how to rewrite products urls to be based on categories names (not category slugs). Let's say this is the structure of the categories and the product: Men (slug: men)...
1
vote
2answers
26 views

add_rewrite_rule with query variables

We have rewrite rules as: add_action( 'init', function() { add_rewrite_rule( 'app-api/v2/ecommerce/([a-z0-9-]+)[/]?$', 'index.php?p=$matches[1]&post_type=product' ); } ); for the URL - www....
0
votes
0answers
23 views

WordPress rewrite rule depend on meta values not ids

I have a custom post type and i'm using the rewrite rule to change the URL from mysite.com/collection?brand1=365&brand2=412 to mysite.com/collection/compare/365-412 But I want to depend on meta ...
0
votes
0answers
17 views

Allowing multiple URLs for same Post

For a specific post, I want to create the illusion of child-posts. The current post permalink structure is set to /%year%/%postname%/. So using this post URL as an example: https://example.test/2020/...
0
votes
1answer
13 views

How to construct a dynamic rewrite rule for child pages that passes more than one query var

I get a 404 error parent-page/any-child-page/?var1=x&var2=y&var3=z This is what I have so far: I want to have the rule cover any child page add_rewrite_rule('^project-centers/(...
0
votes
3answers
79 views

Why wordpress rewrite my custom URL?

I am new in wordpress There may a mapping question in my website I hope this SEO URL is work and get Post data: http://domain/web/d-post/M00069/TomLi If not using SEO URL(get action), it is work! http:...
0
votes
2answers
30 views

Custom Rewrite Rule Removing Query String

I'm trying (and failing) to use rewrite rules to redirect shorter/prettier URLs to the right page AND include values in the query string. WP is installed at https://example.com, and the plugin creates ...
1
vote
0answers
17 views

How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?

(Forgive me, I know this question has been asked extensively but I haven't found an answer that works for me) I'm working on a website for a webcomic. I have a custom post type set up called "...
1
vote
0answers
13 views

Rewrite Rule Working for all but one of the taxonomies created

I have a hierarchical taxonomy, county, which takes a parent and child taxonomy as well as a rewrite rule to include them in my permalinks. I have three of these county taxonomies, but only two of ...
0
votes
0answers
11 views

Multiple Taxonomies rewrite rules for wordpress

i would generate a permalink for multiple taxonomies for a custom post type. I have a custom post type: Location I have these taxonomies: City Location Type I would generate a pretty url while while ...
0
votes
0answers
22 views

How To Change a Search Submit URL

how should i change this url: http://127.0.0.1/infobd/new-info/?keyword=hope To this URL http://127.0.0.1/infobd/new-info/hope using .htaccess or add_rewrite_rule it's a search submit URL on WordPress ...
1
vote
1answer
67 views

Translate custom post type and taxonomy slug in URL?

I need help how to translate the custom post type and taxonomy when using multisite and multi-language. I am using subdirectory a /en /sv etc. Are using the plugin (Multisite Language Switcher), but ...
0
votes
0answers
13 views

Custom permalink structure with categories and custom post types missing top level pages/posts

Having some trouble with an unexpected result here: function features_rewrite_link($post_link, $id = 0) { $post = get_post($id); if ( is_object( $post ) && $post->post_type == '...
0
votes
0answers
15 views

How to have profile URLs like /profile/username?

I am in a problem with creating a profile page.I have created a custom template for profile.I have url slug for profile demo.mysite.com/profile/ this is working file.But If i want to make username ...
1
vote
2answers
30 views

Problem with add_rewrite_rule

Been trying to re-map the following /test-sale-yacht/comfortably-numb-262749/ /test-sale-yacht/?yacht_name_id=comfortably-numb-262749 After some testing in a regular expression tester I've put the ...
0
votes
0answers
21 views

Adding menu title to custum URL

I want to customize my url rewriting this way : urlhome/MenuTitle/PageTitle. Is there a way to do it?
1
vote
1answer
69 views

Wordpress rewrite rules don't need ^?

For example this code class My_Sitemap { public static function install() { add_filter('rewrite_rules_array', array(__CLASS__, 'rewriteRules'), 1, 1); global $wp_rewrite; ...
0
votes
1answer
36 views

Custom permalink structure for custom post types including multiple taxonomy

The goal is to have a structure like this: example.com/tax_1/tax_2/post_name This code produces the right structure but the post can't be found (404) // Register custom post types function ...
0
votes
0answers
40 views

How can I assign multiple parents to CPT?

I have created cpt called product-1, this product qualifies for 2 categories "paints" and "coatings", however I can only select 1 parent for the post. What would be the best way to ...
0
votes
0answers
25 views

Dynamic URL based on keyword

I'm trying to integrate Tradingview charts to my wordpress site. I will store stock name in my database. Suppose someone searches for AAPL, the url should have AAPL as the stock name and accordingly, ...

1
2 3 4 5
38