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

Allow requests to resources outside the wordpress folder

I have wordpress website https://example.com. /wordpress is never part of the url. It runs on a dedicated server that runs Plesk Onyx. The file structure is | - httpdocs | - wordpress | - ....
Sam Dean's user avatar
  • 101
0 votes
0 answers
18 views

How to set product category base the same as shop base in WooCommerce?

I'm using WooCommerce on a WordPress. I would like my products and product categories to have the same url base. E.g. www.example.com/shop/product-category www.example.com/shop/sample-product Using ...
Paweł's user avatar
  • 1
0 votes
0 answers
10 views

I need a permalink post_type structure with taxonomy slug in it for location landing pages and service pages

I am building a Wordpress site that has landing pages for locations in the UK. Each location needs sub pages to represent a service relevant to that location. To do this, I have set up service pages ...
itsthatseoguy's user avatar
0 votes
1 answer
11 views

Blog URL Structure - Multiple Taxonomies

Does anyone know how, if it's possible, to include a base slug, two taxonomies and the blog title are the URL? All posts would have either one or two categories. e.g. /blog/{category-one}/{category-...
Sjwdavies's user avatar
  • 111
0 votes
0 answers
9 views

My images aren't loading after adding update_option('upload_url_path', '')

I tried using update_option('upload_url_path', '/product_large') to change the url of my images. After updating the functions.php my images aren't loading in my site. Any possible solution? Thanks!
James's user avatar
  • 1
0 votes
0 answers
10 views

How to combine nearly identical custom rewrite rules for WordPress

I have 22 rewrite rules in my functions.php. I was wondering if it is possible to combine some of the nearly identical rewrite rules. Combining identical rewrite rules for different PAGES: '^videos/...
Philip's user avatar
  • 103
0 votes
1 answer
37 views

Add post id to url instead of WordPress default -2 suffix

I have a site where Posts in a Custom Post Type will have the same title. Per default WordPress will add a number after the url to handle this but I would like instead to always include the post id ...
Peter Isaksson's user avatar
0 votes
0 answers
29 views

Custom URLs between different post types, using "Pods"

Setup I am using the plugin Pods, and I have created 2 custom post types: location and office. The URLs to access these resources are, for example: /location/new-york (for locations) /office/my-ny-...
Enrique Moreno Tent's user avatar
0 votes
1 answer
29 views

Multisite: Redirect a deleted site - Best practice?

I need to clean up the web server and delete a few deprecated child sites under my multisite install. What is the best practice for setting up a 301 redirect and deleting the old site?
IUWPDEV's user avatar
0 votes
1 answer
5 views

wordpress category rewrite rule with pagination

with the help of someone here I was able to filter two or more categories via this rewrite rule '^combine/([^/]*)/?([^/]*)/([^/]*)/?','index.php?category_name=$matches[1]+$matches[2]+$matches[3]', '...
inrob's user avatar
  • 103
-1 votes
1 answer
19 views

How to make my custom permalink pull up the correct post

I'm tryin to make short urls. Using base_convert, I can change site.com/10 to site.com/a I'm currently using this... function shortest_permalink_make_url( $url, $post, $leavename=false ) { if ( $...
Scot Nery's user avatar
  • 101
0 votes
2 answers
28 views

Wordpress picks a wrong template if ?cat= is used as URL parameter

I have a website with the following article structure. This works and uses archive.php template like it's supposed to website.com/category/articles/arrester/?tag=online-lectures This also works and ...
Natalia's user avatar
  • 131
0 votes
1 answer
20 views

How to change url of posts?

I want to show my posts url like "domain.in/blogs/blogname" . for only the posts not for the pages. how can i make it like that
spidy223's user avatar
0 votes
0 answers
16 views

"-2" Postfix added at the end of the permalink [duplicate]

I know -2 comes due to having duplicate names either in post/pages or media files. But I don't have any such duplicate name. In fact, I tried installing WordPress from scratch and tried to create a ...
Sarmad Nadeem's user avatar
0 votes
0 answers
22 views

WP-Include rewrite directory

I try few day to rewrite wp-include directory but not success. In .htaccess I add next line <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^main/(.+) /wp-includes/$1 [L,...
kuribo's user avatar
  • 1
0 votes
0 answers
14 views

add_rewrite_rule doesn't work when trying to add a new parameter at the end of URL

I wish to add a userq parameter at the end of a URL with the username such as john. I wish to change, example.com/user/john to, example.com/user/index.php?userq=john I tried this and this and they ...
ratib90486's user avatar
0 votes
1 answer
56 views

Change url site.it/wordpress

I need to change the URL of an existing website from www.site.it/wordpress to www.site.it. I searched on the Internet and followed the following steps: I downloaded the index.php and .htaccess files; ...
LuchiniChiara's user avatar
1 vote
1 answer
196 views

Custom rewrite, url path with parameters to a page

I'm developing a plugin, that should display content according to two optional parameters in the URL. The following URL should all be treated by the plugin: /pluginpage/ /pluginpage/value1/ /...
Lorenz Meyer's user avatar
0 votes
0 answers
20 views

How to add page category slug to base url

I use register_taxonomy_for_object_type( 'category', 'page' ); to add a taxonomy to the Page, but the url doesn't show the page's category slug. So is there any way to display the slug of the current ...
pdutie94's user avatar
0 votes
0 answers
32 views

Allow child pages with the same base as the CPT slug

I use WordPress, but I don't use the archive templates, nor the default post. Instead, I create a CPT that will function as my blog, and I use regular pages for archives. This gives me a minor ...
f3bruary's user avatar
0 votes
0 answers
20 views

Post pages are redirecting to the 404 page in wordpress

In my root folder, I have installed WordPress. Now I have created a resources folder in the root and installed WordPress in that too. I am able to login into the resources admin panel and created ...
user9437856's user avatar
0 votes
1 answer
46 views

Problems Implementing Non-WordPress Rewrite Rules

A colleague and I are working on a custom theme and one of the things we need to do is push a specific custom URL type (/team/ for example) into the backend of our website(/wp-content/themes/...
Andrew's user avatar
  • 165
0 votes
2 answers
45 views

Create a page for each database table entries

I am creating a job board website(it is a part of the website). I have a JobOffer class with some rows in the database(added with it's form...). My problem now is to have a page for each of these ...
Brayan Tiwa's user avatar
0 votes
0 answers
53 views

Standard Regex syntax doesn't work in WordPress rewrite rule

I've run into a regex issue while adding a rewrite rule into a Wordpress plugin. This blog has been helpful and the redirect works correctly after following this: https://brightminded.com/blog/...
AutoBaker's user avatar
  • 141
0 votes
0 answers
21 views

WordPress is adding pagination for all pages like www.example.com/page/123. How to remove that?

I think WordPress is adding pagination for all pages like www.example.com/page/1234. In my case, it is adding for all pages not only for the blog page. How to remove the pagination for pages in ...
Murali Krishna P's user avatar
0 votes
0 answers
30 views

How can I add_rewrite_rule for a custom post type to preserve the referral id

I've got this url /referral/{referralId} which needs to redirect to {customPostType}/{customPostSlug}/{referralId} and I'm really struggling to figure out how to do this with wordpress's ...
Will's user avatar
  • 1
0 votes
1 answer
78 views

How to disable WordPress canonical redirect to nearest matching URL and force 404 Page?

WordPress appears to rewrite URLs, displaying Pages under the incorrect URL. Example. I have a page called "Emotion" with the slug /emotion/ On the front-end it should appear as the ...
RedWebMan's user avatar
0 votes
1 answer
53 views

Custom slugs with dates & IDs on Custom Post Type

Trying to do something with the rewrite argument on custom post types. I'm after 2 different things here for 2 different custom post types. 1: Slugs which look like this post-name-year-month-day So ...
robwatson_dev's user avatar
0 votes
0 answers
19 views

Multiple permalinks for a single post from custom field

I'm looking for a way to add additional slugs for regular posts, so that a single post can be viewed from multiple urls. Example: the canonical post url would be: website.com/foo-bar but I want ...
Simon's user avatar
  • 1
1 vote
2 answers
160 views

add_rewrite_rule not working with custom variables

I posted this in stackoverflow as well, so hope it's good to post here as well! I think this is my last problem to solve before everything clicks into place: I have a homepage with a custom plugin ...
johnbell's user avatar
0 votes
1 answer
31 views

Using a variable in page permalink

I'm trying to alter some of my pages permalink by adding a variable in the permalink, it works for changing the permalink, but the link gets 404 error. My page permalink: https://example.com/...
user1181378's user avatar
0 votes
0 answers
23 views

Custom post type with custom taxonomies structure url not working archive of CPT

I trying to adjust url structure for CPT(collections) and custom taxonomy(collection). To create full url like (page.com/collections/collection/cat/subcat I'm using 'rewrite' =&...
mm42's user avatar
  • 1
3 votes
1 answer
33 views

What is the best way to relate different custom post types?

Let's say I have 3 CPTs: series, seasons, and episodes. Now if I post in these custom post types the URL would be: Series CPT > post name: sample serie > URL: site.com/series/sample-serie ...
Mr Mousio's user avatar
0 votes
1 answer
56 views

Rewrite rule taxonomy url with different values in one function

So I'm a little bit stuck here and honestly don't know how to proceed, I'm trying to do a rewrite rule to a series of specific urls I have a movies custom post type and an alphabet taxonomy and the ...
agent abstract's user avatar
0 votes
0 answers
10 views

Using .htaccess to redirect /da/ to / in URL

I have removed /da/ from all URLs on my website, as i have gone from a multisite to a single site. And now i want to redirect all urls from mydomain.com/da/foobar to mydomain.com/foobar So that ...
Anders Jytzler's user avatar
0 votes
0 answers
22 views

Change variants URL

When I create a new varaint, a new item will be in wp_posts table and a new row in wp_terms table. What I want to achive is taht if the oroginal product was http://mysite/the-product-name/ and the ...
vaso123's user avatar
  • 181
0 votes
0 answers
17 views

Rewrite rule to simulate page hierarchy results in 404

On my WordPress site, I want pages with slugs beginning with outline- or result- to be accessible by requesting URI's that begin with outline/ or result/ instead, as if the pages in question were ...
G.S.'s user avatar
  • 15
1 vote
0 answers
36 views

Rewrite URLs in a Custom Post Type with Multiple Taxonomies

I'm trying to filter the content of a custom post type, but I can only get it to read the first variable. The custom post type has 3 associated taxonomies that if I pass them through GET in the URL it ...
Carlos Polo's user avatar
0 votes
0 answers
15 views

Custom post type Premalinks main page and details page

I have a custom post type "movie" with 'rewrite'=> array( 'slug' => 'movies') And I need the following : 1- site.com/movies/nameOfmovie ==> Main Movie page ==> this is working ...
Houssam Hsm's user avatar
0 votes
1 answer
25 views

Custom archive URL as a subfolder of the custom post type slug

I have a Custom Post Type called Whatever. The slug for this CPT is whatever. By default, I can access the posts archive in the frontend at /whatever and each post at /whatever/post-slug But I would ...
Álvaro Franz's user avatar
0 votes
0 answers
18 views

url rewrite doesn't load woocommerce product

I have this woocommerce permalink structure: /watches/google/%prod_cat%/ since for each product I have 2 prod_cat (multi language) eg: "1926-fr", "1926-en", I'm trying to display ...
sfarzoso's user avatar
0 votes
1 answer
47 views

Programmatically add a custom url route "/category/index.json" to return a collection of posts in json

I would like to serve a list of posts pertaining to a specific category in JSON format at this endpoint: /category/category-slug/index.json I figured I could, as a start, point to the REST API for the ...
pixeline's user avatar
  • 2,807
0 votes
1 answer
56 views

How to stop WordPress from replacing plus (+) characters from URL on the front page?

I have a website that is sort of e-commerce website. The list of products is on the homepage. On the left side is a sidebar where you can filter products. Once 2 filters of one category are selected ...
Yaroslav Valsoray's user avatar
1 vote
0 answers
15 views

WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?

You know WordPress is adding pagination for all pages not only for posts page/blog page. For example www.mysite.com, I'm getting URLs like www.mysite.com/page/15, etc. Here, www.mysite.com has a ...
Murali Krishna P's user avatar
0 votes
0 answers
17 views

SQL query to rewrite all media URLs to end with .webp

I have manually converted all media files within the 'uploads' folder to .webp, I have maintained the folder structure, every .webp image remains in the same folder its predecessor was. How do I ...
3vanse's user avatar
  • 13
1 vote
1 answer
53 views

Add rewrite endpoint and .htaccess

I'm trying to make a redirection with .htaccess and rewrite endpoint (add_rewrite_endpoint()) and it's working but at the time of redirection it adds a /1/ to the route and I don't understand where it ...
Javi Ps's user avatar
  • 113
0 votes
0 answers
22 views

Rewrite rule giving 404 error

We have a large Woocommerce site which is based on roots/sage and roots/bedrock. We have a staging site and a production site which are identical in terms of the theme, plugins and are both hosted on ...
the_lar's user avatar
  • 13
1 vote
0 answers
19 views

Wordpress add parameters with friendly url structure

I build a Wordpress website with a page called 'Nieuwsberichten'. The url looks like https://www.example.com/nieuwsberichten This page is dynamic and I need an extra parameter called 'news_page' https:...
Ruudje's user avatar
  • 11
1 vote
1 answer
164 views

How to change custom post type slug without damage seo? [closed]

I need to change the structure of the taxonomy which holds a list of products, actually I have this implementation: http://example.com/watches-product/category/product-name/ but this should be: http:/...
sfarzoso's user avatar
1 vote
0 answers
39 views

add_rewrite_rule not working in Custom Post Type UI Plugin

I created custom post using Custom Post Type UI Plugin. The post type name was: recruit Now my current URL is: http://wordpress-603.com/?recruit=top I want to change it to http://wordpress-603.com/...
クジェー's user avatar

1
2 3 4 5
41