We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Changed URL Structure, set 301 but rankings dropped -30%

Recently I made a url structure change for a website. From: example.com/2019/11/postname To: example.com/postname/ I used the Redirection Plugin to set a 301 for all old posts, with the following ...
0
votes
1answer
16 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
35 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
12 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
10 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
15 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 ...
-1
votes
0answers
18 views

Rewrite Rule that extracts text from the url

Create a rewrite rule that extracts text from the url and uses that to pull variables from the database that then populate the template.
2
votes
0answers
25 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
23 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
20 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
16 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
23 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
170 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
19 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
41 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
20 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
39 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
16 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
37 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
17 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
16 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
23 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
14 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
21 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
24 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
36 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
57 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
52 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
18 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
38 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
37 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
53 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
36 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 ...
0
votes
0answers
23 views

Multisite - WPML Rewrite Url

I'm using WP Multisite and I have this structure of urls for all my sites: example.com/en example.com/de example.com/us example.com/fr In each site I have installed WPML for translations. Each site ...
0
votes
0answers
22 views

How to use .htaccess rewrite for a WordPress site on a multisite hosting

I'm hosting a web app on my-app.pro, and it's the main domain for the hosting. The containing folder is /home/my-domaine/www/my-app.pro/www. I'm using a framework, and it does the rewriting job, so ...
0
votes
0answers
50 views

Rewrite for Posttype

i want my posttypes url structure to be /brand/trailer/ instead of /trailer/. I'm not sure how to do this function anhaenger_rewrite() { add_rewrite_rule( 'trailer', 'brand/trailer', ...
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
63 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
0answers
15 views

Need help to write custom rewrite rules correctly

In my site I have a page with permalink http://dev.mysite.test/option/ and I pass it some values with query string, e.g.: http://dev.mysite.test/option/?value=100, how can I write a correct custom ...
0
votes
1answer
72 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
0answers
16 views

WooCommerce multiple shop bases and rewrite rules

I have a simple installation of WooCommerce that I need to display under two different URLs like so https://www.something.com/shop/category/product https://www.something.com/knowledge/category/...
0
votes
1answer
15 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
44 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
29 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
36 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
0answers
37 views

Refactor Code that manipulates image URLs into function?

I have the following code that removes the "/sites/25" portion of the URL from one of my multi sites. It works fine but needs to be reused in several other areas of the theme. My brain is really ...
0
votes
0answers
38 views

Error 404 when modifying permalink structure of categories

I would like to edit the permalink structure of my site to obtain the following urls : Permalink of articles: /actualites/%year%/%monthnum%/%day%/%postname%/ Permalink of categories: /actualites/<&...
0
votes
1answer
53 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 ...