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
75 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('...
0
votes
1answer
35 views

Remove part from dynamic url and redirect

How do can I redirect the following URL to the next URL? It essentially should remove the ID part (this is a post tag URL). http://wpsoup.test/tag/88/koffie/ -> http://wpsoup.test/tag/koffie/. I've ...
0
votes
0answers
127 views

Rewrite dynamic URLs as pretty URLs in Wordpress functions.php (add_rewrite_rule) - what's wrong with my code?

I'm using an events calendar plugin to list events on my WordPress site. It uses a custom post type to give each event its own page. There are one-off events and recurring events (eg an event that ...
0
votes
1answer
23 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
31 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
52 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 ...
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
86 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
54 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
32 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
25 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
2answers
105 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
74 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
106 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
80 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
34 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
130 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
116 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 ...
2
votes
0answers
57 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
104 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
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
27 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 ...
2
votes
1answer
254 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
1answer
768 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
1answer
43 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
1answer
116 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
25 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
28 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
134 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
2k 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 ...
1
vote
1answer
255 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
51 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
146 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
61 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
55 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
vote
0answers
28 views

Read GET parameters in APACHE Mod Rewrite rules for WordPress categories in Posts

I'm a self-taught programmer with a very little experience in WordPress programming. I'm using a post permalink structure in this way: https://domain.com/parent-category/child-category/post-title-...
0
votes
1answer
84 views

Adding URL prefix for foreign language support

I've done some research to use it for my own complicated system (Using Plugin or Functions.php). In fact, what I want to do is add a prefix at the very beginning of the URL structure of WordPress and ...
0
votes
1answer
412 views

Display CPT taxonomies as an archive page

Hello Stack Exchange people, I created a custom post type called articles. I also created a taxonomy city for that specific post type. I can create a custom post and set a city to it and it gives ...
0
votes
1answer
305 views

How to pass username in url

I have several author page like mysite.com/author/username1 mysite.com/author/username2 I want to create a dynamic url like mysite.com/author/current_loggedin_username How to create this.
0
votes
2answers
52 views

Passing parameter through permalink structure

I have a WordPress post which is accessible via domain.com/test/ What I want to be able to do is pass in a parameter using the URL - ie going to domain.com/test/ would load the same page as domain....
1
vote
1answer
57 views

CPT Archive with core Category

I have a custom post type of news_archive and they are using WordPress Categories. I would like to get some archive pages for these categories with only the CPTs and not core Posts. I managed to come ...
1
vote
1answer
50 views

How can i have a custom post type with more slugs for each post?

I have a post type /city/ .. lets say i create a city called toronto with the slug toronto-canada. now i have /city/toronto-canada/ is there a way i can have more paths for each post in the custom ...
0
votes
1answer
425 views

Using a Rewrite URL in a Plugin to Load a New Page in the Template

I'm working on a plugin that I need to load some custom code. However, I want it to load within the template, while still giving me the ability to change the page title, meta description, etc. I've ...
0
votes
1answer
91 views

How can I add rewrite rules to a class-based plugin?

I'm working on a custom plugin that requires a few rewrite rules. I've followed the documentation but the rules aren't executing. I've tried some variations but I keep getting errors. This is an ...
0
votes
1answer
976 views

Change custom post type slugs, with category/taxonomy before post type name

I'm currently working on a website which is a collective name of 2 schools. That's why I've renamed the taxonomy categories to schools. So in every post of a custom post type I can select the right ...
0
votes
0answers
38 views

How to redirect to a login virtual page?

I'm writing my first WordPress theme from scratch. I need to redirect not logged in users to a virtual login page, when I do wp_safe_redirect( get_site_url() . '/login' ) I would show a virtual page ...

1
3 4
5
6 7
39