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
1answer
22 views

How to get relative page for every post: /post-1/contact. /post-2/contact

Let's say I have a post type called jobs, and a page called contact with a form in it. Now I want the contact page to show on every job url ending with /contact. So job-1/contact, job2/contact etc. I ...
0
votes
1answer
17 views

I want to change url structure of my created archieve pages

i have created custom template in which i have run query from database . in the page i have run loop from database so i am taking id through url to another page and the link is creating like this ...
1
vote
0answers
20 views

Rewrite rules automatically for pages using specific template

I'm using rewrite rules to add an optional parameter to a page. This page uses a specific page template which handles the implementation of an external data source. add_rewrite_rule('^page/([0-9]+)/?'...
1
vote
0answers
28 views

How to use add_rewrite_rule in subdomain

I need to understand the concept of add_rewrite_rule() in wordpress in my case I have a subdomain based website by wild card I created a custom page called X.php This custom page function is to get ...
1
vote
0answers
18 views

Index page with the same id as the slug

I have wanted to ask this for a long time.. I have never worked out how to do this, is it possible? mywebsite.com/pots - This to be an index page showing posts or custom posts mywebsite....
0
votes
0answers
11 views

Website URL Permalinks

I used Prophoto 4 and recently upgraded my site to Profoto 7 and moved to a new Profoto template. My website URL is www.lorrainebhandariphoto-video.co.uk Now my site address URL and wordpress address ...
0
votes
0answers
23 views

Rewrite rules for custom taxonomies

I got car custom post type. And got custom taxonomies (model, year, color) for car post_type. Car archive link looks like this: https://example.com/car/ And i am filtering this archive page with $...
1
vote
0answers
11 views

Create one page, land any other URLs starting with that page to the same place [duplicate]

I would like to create a Wordpress page, for example "Foods" Then I want every single one of the following URLs to land on the "Foods" page. There could be unlimited number of URLs that lead to the "...
1
vote
0answers
38 views

Change pagination url format

I have a URL like this: example.com/blog/page/5 I want to change it to: example.com/blog/page-5 I tried using a RewriteRule like this: RewriteRule ^blog/page-([0-9]+) /blog/page/$1 but this ...
1
vote
1answer
39 views

NextGEN Gallery Lightbox - Social Share URL Redirect

I am using NextGEN Gallery Pro - Lightbox's Social Share feature on my WordPress site which actually create and share a temporarily created url (first-url) on social media. Somehow the redirect doesn'...
0
votes
0answers
29 views

CPTs relationship

I have two CPT - project and publication. Is there a way to "connect" those CPSs to the permalink looks like: foo.com/project/lorem/publication/ -> archive-publication.php foo.com/project/lorem/...
1
vote
0answers
17 views

Custom Post Type - Category Rewrite - Remove Rewrite from Sitemap

I've got "case_studies" post type and categories for it as "case_studies_categories" with a rewrite to include category in URL. Everything works, but for some reason, rewrite url is in sitemap (as ...
0
votes
0answers
82 views

Two Custom Post Types in Permalink + Duplicate Slugs Issue

I'm having some trouble with WP adding those numbers onto the end of my slugs if it thinks it's a duplicate slug. The issue, though, is that it's not actually a fully duplicate URL, since I include a ...
0
votes
2answers
50 views

WordPress URL redirect and replace ? question mark

Following is example of what we are looking for. We're trying this in wordpress and we require all parameters as a variable Example 1 : http://example.com/tno/?parent=abc Need this : http://example....
1
vote
0answers
47 views

How to remove specific category from URL in Wordpress

My custom structure permalink is set as shown below and category base is set to . /%category%/%postname%/ My current URL structure is this: http://example.com/aaa/slug http://example.com/bbb/slug ...
1
vote
1answer
78 views

Can't change first part of URL rewrite for custom post type

I have successfully created a custom post type with a URL rewrite that changes URLs from: domain.com/post-type/slug To: domain.com/some-string/custom-field-value-1/custom-field-value-2/slug This ...
0
votes
1answer
63 views

Rewrite rule for custom permalink structure

I have a Custom permalink Structure setup Settings > Permalinks as: /%category%/%postname%.html But I want my url structure to replace /%category%/ by /%articles%/, so it looks like- mydomain.com/%...
0
votes
1answer
22 views

virtual page using url parameters to solve facebook sharing issues

Reaching out for help, as my head is spinning! In my site I have the ability to dynamically generate pages and I use URL parameters to indicate the database and record to use to retrieve the ...
0
votes
1answer
77 views

Pass parameter to custom post type single while keeping clean url

I'm working on passing a get parameter to a single custom post type in a clean url. So for instance there would be the custom post type 'services' which would have the single post 'gardening'. /...
0
votes
1answer
47 views

Show category name in the post URL only for specific categories

Is there a way to show the category name in the URL of a post which is in a specific category? I.e: I have a site which have a blog and two categories, blog and resources; right now this blog have ...
0
votes
0answers
28 views

Special Characters Url return to 404

I've managed to have permalinks with "@" (at sign) for my page with the help of @Andy's code on How to add dot(“.”) in post slug. But unfortunately, after creating post with @ on the url (example....
0
votes
0answers
27 views

How to change Wordpress dashboard login url to website URL?

I have a Wordpress website www.example.com Once a user goes to URL he sees Wordpress login page and below URL in the browser address bar. www.example.com/wp-admin/.... I want to change that ...
2
votes
0answers
42 views

Rewriting Woocommerce Product Filters To URL Segments

I'm working with a site where product category pages are filtered using query parameters: ?color=red&brand=nike&size=10 I'd like to use URL segments instead and rewrite the request to the ...
0
votes
1answer
48 views

add_feed rewrite overwriting standard permalinks

By doing a simple: add_feed( 'schedule', 'my_schedule_feed' ); I have created a feed at /feed/schedule/... easy. But when I go to /schedule/ (which is a page) it is now showing the feed! Looking ...
0
votes
0answers
24 views

Why is this rewrite rule not working (for a custom route)?

I am trying to setup a paypal return url of the form somesite.com/paypal-return In my child theme root I have file called paypal-return.php In my child theme functions.php I have /* * Set up a ...
0
votes
1answer
21 views

How can I re-query post_type and rewrite the url?

I have the url slush like the below. /category/land-residential-farm/?property_com_listing_type=sale I want to write the url to /category/land-residential-farm/property-for-sale then re-query the ...
0
votes
0answers
26 views

WP permalink working, but why content doesn't display

I'm running a wp-blog on LEMP stack, I'm setting permalink fro WP Admin panel to say example.local/blog/%postname% it shows full post name in the address bar, when I click any post, but it doesn't ...
0
votes
0answers
11 views

Build optional prefix for both post and pages, based on meta

I have posts and pages that have a metabox "new" which saves the meta new in the database for the post. What I am trying to achieve is to have an optional prefix /new/%slug% which shows the post if it ...
2
votes
1answer
194 views

Rewrite url for existing page without flush_rewrite_rules

I have created pages with slug test123 and test234 in wordpress, I want to create a plugin that doing the following when user request test123, and the content in test234 will be served instead. I ...
0
votes
0answers
25 views

Change url based on logged in user/different root?

I'm not sure how to word this question so I'm sure the answer is out there but I'm using the wrong search words. I have a URL where the end remains the same, but the beginning changes based on the ...
0
votes
1answer
410 views

add_rewrite_rule: Issue converting path to url

I would like my plugin to route /tradeIns for any domain it's installed on to the template file inside the plugin filder's templates/checkout.php. In my local dev site the desired url route would be ...
0
votes
0answers
22 views

Create category with special permalink

My usual permalinks are /%year%/title but for posts that in the category timeless, I want to remove the year. I have the following code, but the issue seems to be add_rewrite_rule is having no ...
0
votes
1answer
42 views

Custom Post Type Category URL

I've created a simple CPT named shop which contains some shop items. After that I've added category support to it which works fine ('taxonomies' => array( 'category' )). Then I created template-...
0
votes
0answers
17 views

woocommerce remove last sub category from product url

I am working on migration site. after migrating i am trying to make url look same as live site This is current url: https://photoland2.etrafficgroup.com.au/frames-and-albums/frames/wooden-frames/106-...
0
votes
0answers
38 views

Permalink Rewrite Rule Issue in CPT

For a custom post type blog in my site, I want to have the following permalink structure: mysite.com/blog/post-slug/post-id I am using the following code in my theme: function blog_links($...
0
votes
0answers
18 views

How to update rewrite rules after making “post” post type hierarchical?

I made the default "posts" post type hierarchical and added a filter to "post_link" that calls get_page_link on the $post->ID if a post parent is present. Then the parent-child-relationship is ...
0
votes
0answers
25 views

Dynamic URL with custom tag permalink

I'm trying to have some dynamic URL. I made a custom tag for my permalink to show the language of the blog, but i'm facing an issue with dynamic URL. The problem is that it only consider 'fr' in my ...
0
votes
0answers
25 views

Different Post URL Base for Specific Categories

By default WordPress allows you to edit the permalink structure: Ideally wanting to have most posts as a simple URL such as site/post-name. However a few categories such as events, news, and albums I'...
0
votes
1answer
39 views

How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially

My site uses a plugin Easy Digital Downloads, which creates products that are of url structure, sitename/downloads/{Product} I want to change them to sitename/{product} For example, https://milyin....
0
votes
0answers
23 views

Custom taxonomy named 'tag' return 404 page

I registered a custom taxonomy named 'tag', code below: add_action('init', 'reg_custom_tag'); function reg_custom_tag() { register_taxonomy('tag', array('my_custom_post_type'), array( '...
0
votes
1answer
27 views

Extra url paths as variable

I have this WordPress pretty permalinks structure: https://example.com/house/name (where house define post_type) I want this one url: https://example.com/house/name/2/3 (that works like https://...
0
votes
0answers
90 views

WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file

Looking to update my WP Login Flow open source plugin to prevent using rewrite URLs in things like Lost Password, Login, Register, if the rewrite file does not exist on the server -- but need some ...
1
vote
1answer
919 views

Rewrite rule to load images from production does nothing

I'm trying to adapt the rewrite rule given in Develop Locally, Use Images from Production to do the very same thing on my local dev site (which runs on XAMPP). This is how the development site's ....
0
votes
0answers
10 views

Flushing rewrite rules enables to see an article, but I didnt change anything

I know this wont be so precizely written, but I cant describe it any better. Im in admin, and I pressed the save button on "permalinks option". I have an article: www.example.com/video/title which ...
0
votes
1answer
144 views

How to remove trailing slash from root Wordpress folder?

My WordPress in installed in a folder, https://example.com/folder/. I would like WP index page to get accessed by https://example.com/folder, however, WP 301 redirects it to https://example.com/folder/...
1
vote
0answers
22 views

Multiple permalinks for Wordpress post types

I've set a custom permalink on Wordpress so all my blog posts end up as example.com/blog/post-title Where post-title is the title of the post. This helps keep track of all the blog posts vs pages, ...
1
vote
0answers
44 views

Changes in permalink structure in WordPress and how to apply to in-site links

I have some work for wordPress internationalization. Actually, I got good results. Part of my code: add_filter( 'query_vars', 'queryi18n' ); function queryi18n( $query_vars ){ $query_vars[] = '...
1
vote
0answers
69 views

Need to add trailing slash to all internal links relative and absolute

i need to rewrite the url path of my href internal links. I got into my site relative and absolute links. ex. <a href="https://www.sitename.com/pippo" <a href="/pippo" <a href="/pippo/" I ...
1
vote
0answers
60 views

Wordpress Persistent connection rule does not work for “posts”

add_action( 'init', 'rule' ); function rule() { add_rewrite_rule( '^(en|fr|de|ru)/(.?.+?)/?$', 'index.php?lang=$matches[1]&pagename=$matches[2]', 'top'...
1
vote
1answer
44 views

How can I make the slug of the taxonomy also the slug of the custom post

I have a custom post type and I need to change the slug to match the category. The same as if in the permalink of the blog posts I associated the category with %category%, but in the custom post with ...

1 2
3
4 5
37