Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [url-rewriting]

Refers to the process whereby an URL is manipulated to create what in WordPress is called a "pretty permalink"

1
vote
0answers
10 views

Rewrite: WordPress URL rewrite on Search

I am trying to create a URL rewrite in wordpress. I am creating a search from through wordpress. The URL structure I currently have is the following: http://localhost:8888/?post_type=CustomPost&s=...
0
votes
1answer
13 views

Rewrite nested urls for custom post type

I have a problem with nested permalink. I have a structure of urls like that: Catalog -> Category -> Product My urls are: www.domain.com/catalogs (for archive catalog) www.domain.com/catalogs/...
1
vote
0answers
19 views

How to create a URL Rewrite rule?

I created a page template that gets products by brand ID using a query string in the URL like so: https://example.com/all-products/?brand={brand_id} Due to a request, the URL needs to read https://...
0
votes
0answers
32 views

React Router with Wordpress

I am using React Router (React app in a home page) with WordPress. The problem is when a user first loads a page with client URL route, for example site . com/recommendations, they see a 404 error. I ...
0
votes
1answer
12 views

Rewrite of Custom Post Type doesn't work with dynamic data

I created a Custom Post Type in my plugin. I added an argument with rewrite: 'rewrite' => array('slug' => 'foo/bar/%baz%', 'with_front' => false), Then I added a method to replace %baz%: ...
0
votes
0answers
11 views

Pretty product category URLs for duplicate sub-category slugs in WooCommerce

In Wordpress / WooCommerce I want the urls of product categories in a strictly hierarchical pattern even if subcategories receive equal sub-path - as it works e.g. with pages. Example: I have two ...
0
votes
1answer
24 views

Passing & Reading URL Parameters with URL re-writing

I’m fairly new to wordpress and all my previous sites have been in .asp or raw .php. and although I can tinker I’m no developer and due to time constraints I was hoping this would be an easy fix - but ...
0
votes
0answers
29 views

How to set this permalink structure? /custom-taxonomy/custom-post-type/post-name

I'm coding a WordPress website for a festival that takes place in several cities. My custom post type is events and the custom taxonomy is city. I would like to have a permalink structure like this: ...
0
votes
1answer
31 views

Programmatically add custom field to post_name in a custom post type

I have a simple custom post type set up for Events. I'm using Carbon Fields to add a Start Date field which I would like to include in the post_name. For example: http://example.com/events/20190401-...
0
votes
0answers
21 views

page slug vs add_rewrite_rule priority

Let me try to explain what I need, it it's possible to achieve. I'm developing a plugin with listings management, I've already built a custom template with listings, details and search form. It ...
0
votes
0answers
20 views

Custom rewrite rule don't pass parameters

I created a page template where I list some properties I get from an external source, but a need to to recover an URL parameter in order to get the right properies... For example, this URL : www....
0
votes
1answer
26 views

Add %post_id% to slug of custom post type and prevent the “unique slug” thing that WP does?

I have a custom post type called "equipment". I would like the permalink structure to be: example.com/equipment/%post_id%-slug I specifically want it to use a dash and not a slash (i.e. - "id-slug" ...
0
votes
2answers
57 views

Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post

I am building a custom post type and its respective custom taxonomy. Here is the code: add_action( 'init', 'register_my_types' ); function register_my_types() { register_post_type( 'help', ...
0
votes
1answer
17 views

Redirect Custom Post Type from Child Taxonomies

I have created a Custom Post type and its own respective taxonomy. I have for example this URL structure: http://www.example.com/faq/category/sub-category/test-post/ The same content can also be ...
0
votes
0answers
36 views

Rewrite rule not working, suspect redirect string

These rewrite rules are killing me. It is probable something little, but I can't find it. I have a custom post type called 'tournament', it's permalink structure looks like <domain>/<...
0
votes
1answer
15 views

Passing a variable to hyperlink text?

Hope the question is not phrased badly Is it possible to pass a variable to for example having an: echo '<a href="' . esc_url( $link ) . '"> $link </a>'; so that the hyperlink is the ...
0
votes
0answers
12 views

There is how to change url domain on some posts?

There is how to change the URL on some posts? Like, for example, my website is www.mydomain.com, on posts it's like www.mydomain.com/post now can i change some posts to a url like www.myotherdomain....
0
votes
1answer
29 views

Rewrite Page Parameters

i have a page call "city" http://localhost/wordpress/city/ and it get details from mysql by url id like http://localhost/wordpress/city/?id=paris and i want to change it like http://localhost/...
1
vote
2answers
26 views

How to redirect specific URL to Subdomain

I am trying to write a .htaccess rule to redirect the URL to a subdomain. Example: example.com/pagecategory/page-single → pagecategory.example.com/page-single I've added wildcard subdomain on my ...
1
vote
1answer
27 views

Custom rewrite not working

I'm trying to rewrite URLs on my wordpress site to match Googles "seo friendly" policy. I want to rewrite URL's for 3 types of queries generated from search plugin: a) Location example.com/used-...
0
votes
0answers
32 views

How can I put WordPress in a directory but keep just the home page at the domain root?

I look after the site(s) for a large annual event. Each year we want to archive last year's website and the last few years I've done that by making a copy of WordPress in the appropriate directory. ...
0
votes
0answers
18 views

“Masking” a sub-page as it's own domain (www.schools.com/americanschools) as (www.americanschools.com)

I currently have a site, where I want one of it's sub-page's to be "masked" under a single domain. Example: I have www.schools.com/americanschools It's a sub page that only displays schools in ...
1
vote
1answer
37 views

Custom post-type in root directory, blog posts in subdirectory

I have a website with one custom post type as well as a blog. For the custom post type I would like to have the slug as root, like so http://domain.com/<title> And the blog post I would like ...
0
votes
0answers
18 views

How to Include only last Sub-Category in Wordpress URLs

I have following categories: -Mass Storage --Pen Drive When set custom permalinks settings to this "/%category%/%postname%/" It results like this: http://www.example.com/product/mass-storage/pen-...
0
votes
2answers
13 views

URL rewrites af

I'm trying to make some pretty URLs that show content from a category page. An example would be this: https://example.com/resources/white-paper (not a real WP page) would show content from https://...
0
votes
0answers
25 views

Hide wordpress source code

Hey guys Iv searched all over maybe Im not using the right terms. Im trying to stop the index off my wordpress site tree structure like wp-content wp-content\plugins etc on the sources panel in chrome ...
0
votes
0answers
14 views

Dynamic URL crawled in Wordpress at Page Level

My website settings looks fine including Permalinks (set to "Post name"), and .htaccess. But when I click on Page 2 (at bottom of my website), it shows strange URL like page/2/?fbclid-Iw.... (please ...
1
vote
1answer
21 views

Page and Post return 404 with custom taxonomy

I have registered a custom taxonomy on "post" named "cat_modules" with this args: 'rewrite' => array( 'hierarchical' => true, 'slug' => '/', 'with_front' => ...
0
votes
0answers
22 views

add_rewrite_rule causes redirect to homepage

I want to create an alias url for my homepage so that it can be accessed at / but also /alias I've set up a rewrite rule but it just causes a redirect to / add_rewrite_rule( '^alias?', '...
0
votes
1answer
20 views

How to give .html extension to just one post not all post

WordPress Allows us to make a custom link to the Posts like helloworld.html but, How to give .html extension to just one post not to all posts. It would very helpful if you provide any plugin, code or ...
0
votes
1answer
25 views

Custom Post Type Advanced Slug

I've been searching for a little while now, and I'm not even sure if this is possible. I have a custom post type 'holidays', for the post, with a category taxonomy 'locations' to put the posts into. ...
0
votes
0answers
22 views

Append query string to all URL's

A user will be directed from a website to a landing page that will have a query string in the URL i.e. www.sitename.com?foo=bar&bar=foo. What I want to do, is then append that query string to all ...
1
vote
2answers
36 views

Cleanup URL for a custom page in wordpress

I have a wordpress website in which I have a specific page for dictionary. This page is actually a custom page and does these things: site.com/dictionary lists all the words site.com/dictionary/?w=...
0
votes
0answers
13 views

WordPress multisite, redirection to subdomain

I have a WordPress site that works in multisite. The main URL just serves as a cover page to redirect visitors to their store relative to a Google map. Once on their store mag1.mysite.com for example, ...
0
votes
0answers
12 views

htaccess redirect multisite

I have a multisite wordpress like monsite.fr and subdomain sub1.monsite.fr sub2.mysite.fr ... I have a booking module "salonbooking" At the click of a button from the booking part of sub1.mysite.com I ...
1
vote
2answers
42 views

I need a custom permalink for my website

I have following scenario: my-domain-name.com/google.com my-domain-name.com/twitter.com I need a custom permalink structure to pass google.com or twitter.com to domain_name query variable. I have ...
0
votes
0answers
17 views

Issue with custom rewrite for products and permalinks

Not sure if I've done something incorrectly here, but I have the following rewrite rule; add_rewrite_rule( '^product/([0-9]+)/([^/]+)/?$', 'index.php?name=productl&id=$matches[1]', ...
0
votes
1answer
60 views

Insert post ID into the end of a slug preceeded by a dash

I would like to dynamically insert post IDs into their URL slugs. What I have Code that strips out the prepended post name (WC's '/product') Code that generates the URL that I want What I want ...
0
votes
0answers
33 views

Allow Duplicate Child Term Slugs for Taxonomies Using term_link

I want to re-use term slugs for a taxonomy when they are children. I realize that some may just advise to change hierarchy structures to avoid this, but that will not work for me. What I have: Code ...
0
votes
0answers
60 views

add_rewrite_rule not working. Returns 404

I'm adding custom URLs in Wordpress using add_rewrite_rule. Following is my code:- add_action( 'init', 'some_function' ); function some_function(){ global $wp_rewrite; add_rewrite_rule( // ...
0
votes
0answers
29 views

WordPress admin url rewrites to be used with Vue router

Using Vue in a custom plugin with vue router, how would it be possible to rewrite wp admin urls with query params? The web server is Nginx My link looks like /wp-admin/admin.php?page=my_plugin. I ...
0
votes
1answer
42 views

Pretty URL via Rewrite

I'm building a dynamically populated profile page for my site users. This currently uses the following URL structure: https://example.com/members-list-profile/?&uid=XX I'd like to improve the ...
1
vote
0answers
28 views

joomla to wordpress migration and 404 errors issues [closed]

I had migrated my website from Joomla to WordPress with "FG Joomla to WordPress premium" the problem is that I have more than 2900 posts in my website they all are now imported in WordPress version ...
0
votes
1answer
32 views

How to change url for taxonomy pages?

My Wordpress default category has 'news' category term. I created custom post type with name 'artist' and custom taxonomy named 'genre'. Now what I set in permalink section is below custom structure -...
0
votes
1answer
32 views

Pretty Permalinks with CTP and Taxonomies / Hierarchical

My Site has 2 Custom Post Types with a 2 Taxonomies. One taxonomy is “Location” which is 2 level / hierarchical (Country, City). My goal is to get our Post Types & Taxonomies in a SEO Pretty ...
0
votes
0answers
28 views

History API & URL for single long page

I'm working on a NON-API Wordpress site. One of the pages is a long page segmented into several sections. At the top of the page is a menu for most of the sections on the page. When a user lands on ...
0
votes
0answers
13 views

Use same content for different languages with language in url

I have a post-type "inventory" that don't need translations. I have made a page-template and made pages for all languages in wordpress and assingned the inventory page template to it. So I have /en/...
1
vote
1answer
132 views

Home page with Polylang redirects to other page

On my website : https://www.littleguestcollection.com/, the homepage is redirected to other page (this one : https://www.littleguestcollection.com/fr/hotels/lux-tamassa/). I have no idea what is the ...
0
votes
0answers
39 views

URL Rewrite 404

I've got the following ReWrite rule: add_rewrite_rule("details\/([a-zA-Z0-9_]+)\/.*", "detail/?id=$matches[1]", "top"); Which seems to be adding in the following to my .htaccess, which now looks ...
0
votes
0answers
28 views

add_rewrite_tag broke permalinks that doesn't use that specific tag

I have a custom post type that I'd like to have a permalink slug based on its taxonomy. All the posts of this CPT have one, and only one, term always marked on this specific taxonomy. That's my code: ...