Questions tagged [url-rewriting]
Refers to the process whereby an URL is manipulated to create what in WordPress is called a "pretty permalink"
2,036
questions
1
vote
1
answer
41
views
+50
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/
/...
0
votes
0
answers
15
views
website migration url HTAccess rewrite rule [closed]
I couldn't find any post about my exact problem and I'm not smart enough to try&error things on a live website.
So please help.
I want to migrate Website A into Website B and I know that I need to ...
0
votes
0
answers
14
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 ...
0
votes
0
answers
28
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 ...
0
votes
0
answers
19
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 ...
0
votes
1
answer
40
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/...
0
votes
2
answers
43
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 ...
0
votes
0
answers
38
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/...
0
votes
0
answers
20
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 ...
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 ...
0
votes
1
answer
37
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 ...
0
votes
1
answer
26
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 ...
0
votes
0
answers
15
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 ...
1
vote
2
answers
63
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 ...
0
votes
1
answer
29
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/...
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' =&...
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
...
0
votes
1
answer
32
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 ...
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 ...
0
votes
0
answers
20
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 ...
0
votes
0
answers
16
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 ...
1
vote
0
answers
28
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 ...
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 ...
0
votes
1
answer
18
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 ...
0
votes
0
answers
16
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 ...
0
votes
1
answer
18
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 ...
0
votes
0
answers
42
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 ...
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 ...
0
votes
0
answers
13
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 ...
1
vote
1
answer
37
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 ...
0
votes
0
answers
17
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 ...
1
vote
0
answers
14
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:...
1
vote
1
answer
95
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:/...
1
vote
0
answers
27
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/...
0
votes
0
answers
23
views
Custom Post & Taxonomy rewrite break regular post & page
I'm facing redirection issue with my custom post & taxonomy. I used to create Custom Posts & Taxonomies under "subdirectory" (if I can call it like that?) like :
mywebsite.org/...
0
votes
0
answers
16
views
Custom taxonomy with page post type - Wordpress
I need to add custom taxonomy before every page name, similar to polylang or wpml. I can add text to link but i have 404:
function lang_pages_permalink( $permalink_structure, $page_id ) {
if ( ...
0
votes
0
answers
25
views
Looking for advice how to approach building a Wordpress plug-in
I do build Wordpress sites and plug-ins, though I consider myself more of a PHP developer, and that's how my mind thinks first, not immediately knowing a lot of the available Wordpress functions.
I ...
0
votes
0
answers
15
views
Add additional URL variations for a Post
My goal is to have multiple variations of the same URL resolve to the same Post. The Post itself would have some different treatments based on the URL the reader followed to get there.
In searching ...
0
votes
0
answers
21
views
Use add_rewrite_rule to change subpage url
I use to break my post into several web pages. I would like to use add_rewrite_rule and change the url.
Example request url:
http://domain.com/foo/2
It would get transformed to
http://domain.com/foo-...
0
votes
0
answers
17
views
Rewrite Rule for custom post type link with or without taxonomy terms
I tried to find the solution for a custom post-type URL rewrite with or without taxonomy terms but I can't find the proper solution because I have some odd requirements. The following code is working ...
0
votes
0
answers
28
views
Menu Structure and URL structure, with Pages and Post-Type-Posts
I have some szenarios where I'm stuck. I'm asking from a perspective of someone who can code and wants to avoid using plugins.
If you want your menu to have this structure:
Events (custom post type ...
0
votes
1
answer
42
views
URL rewrite parameter lost (add_rewrite_rule)
This is definitely not the first question regarding the issue. I have read a lot and tried, even more, but without success.
I want to do the following: rewrites URLs
from: example.com/cars/lambo
to: ...
0
votes
0
answers
64
views
Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
A notionally custom post type is created - mods
I want url to be of type site.com/mods/XXXX where XXXX is serial number in category (not global ID(%post_id%)) That is it starts with 0 and goes further ...
0
votes
0
answers
43
views
How to add unique auto-increment number on url before slug
How to add an auto-increment number for each post's URL just before slug.
For example, the URLs will be:
https://website.com/1/post_name
https://website.com/2/post_name_2nd_post
...
https://website....
0
votes
0
answers
67
views
Remove "?category=" in the URL wordpress ajax filter work for category
I need to remove "?category=" in the URL?
We are building a category filter through ajax and we need to remove "?category=" in the URL. Below is our URL
https://exelgroupstg....
0
votes
0
answers
36
views
Wrong rewrite rules
I have rewrite rules like this
'forum/(.+?)/?$' => 'forum=$matches[1]',
'forum' => 'pagename=forum',
website.com/forum -> correct
website.com/forum/page/2 -> 404 because it detect ...
0
votes
0
answers
13
views
Spurious URL structure (Adding extra /0/s)
We have just used a reputable external crawler to test our site and it is listing many (1,000s) of pages that have /0/ or /0/0/ or /0/0/0/ etc appended to the URL
so https://example.com/news/news-post-...
0
votes
0
answers
20
views
Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL
I have a Custom Post Type with 4 Custom Taxonomies. Everything is working great about this part.
But, right now my taxonomies pages URL are: website.com/taxnomy/taxonomy-item
I would like to have: ...
0
votes
0
answers
71
views
Add rewrite rule to make Woocommerce product category page seo friendly
I want to show sale products of that particular product category page by using /sale except using a query string stock_status=onsale.
e.g
https://www.example.com/sneaker/?stock_status=onsale
It ...
0
votes
1
answer
20
views
Page not found: Custom search form with a custom search page
Let me show you an example of what I'm trying to achieve. On BBC website when you click the search BBC button on the navbar it brings you to a search page (https://www.bbc.co.uk/search). When you put ...