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

add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working

I want to want to make url friendly urls for a custom function I am using in my website. I have added a custom template on my theme dir. The url rewrite function that looks like this: function ...
3
votes
1answer
72 views

Custom post type permalink changing itself every other change

I have created a parent > child > grandchild structure. (Courses > Series > Episodes). I have created the below code which updates the urls for each of the custom post types so that I can have the ...
1
vote
0answers
103 views

Wordpress custom post type permalink rewrite shows page not found

I need to have 3 custom post types in my wordpress site, each one being a parent of another. Courses > Series > Episodes I have fully created a functions file that registers the custom post types ...
0
votes
1answer
29 views

How to fix 404 on post after prepending Custom Post Type url with Custom Taxonomy Term slug

I'm setting up "special" url structure for posts etc Result i want to get is: sitename.com/club/justcavali club is term from taxonomy (club_type) and justcavali is post type (booking_type) after i ...
2
votes
2answers
690 views

Add Rewrite Rule to point to a file on the server

I'm trying to add a rewrite rule that will point to a file inside a plugin. This can be added in the plugin, theme or .htaccess file. My current code from inside the theme's function.php looks like: ...
0
votes
0answers
38 views

How wordpress core include search.php with $_GET['s']?

I want to include custom_search.php when there is $_GET['my_s']. As you know, if we type on a search field, WordPress core includes search.php file because WP Core get $_GET['s'] as query var. How ...
0
votes
1answer
305 views

Rewriting url for multiple Taxonomies and Custom Post Type

I have 2 taxonomies ( genre and artist ) and Custom Post Type ( Lyric ) the url structure i want to get is CPT: /lyrics/ - archive page for CPT Artist: /lyrics/artist/ & /lyrics/artist/song-...
2
votes
4answers
365 views

Custom rewrite rule sends 404 header on multisite

I have a custom rewrite rule which rewrites /wp-content/themes/my-theme/manifest.json to /index.php?manifest=true. This generates some JSON code for progressive web app functionality, and generally ...
3
votes
1answer
89 views

Taxonomy rewrite question

I have custom post types for dining, lodging, and activities. Each of those custom post types uses a custom taxonomy called region. If, for example, I have a region called "downtown", I would like to ...
1
vote
0answers
40 views

How to show the root webpage on all subpaths

I want to show the same page on all the subpaths on my web site /events/ /events/firstOne /events/secondOne/edit /events/whatever/blahblahbla/helloworld All that urls must load the same root page. ...
0
votes
1answer
33 views

Unable to access the query variables in the template

I added a custom endpoint 'product' in the pages. add_action( 'init', 'add_endpoints'); function add_endpoints() { add_rewrite( 'product', EP_PAGES ); } I added a shortcode called `'dashboard' ...
2
votes
1answer
96 views

Having trouble with using add_rewrite_rule and pagination

We have a section on the site, such as: www.example.com/for-sale/category-name/ for-sale is a WP page, however category-name is dynamic and is what I wrote the below rewrite rule for. ...
0
votes
0answers
260 views

Custom Post Type parent/child relationship rewrite rules for permalinks

I have been working on this for quite awhile but I'm stuck at rewriting the permalinks for both the parent and the child. So I created two custom post types: magazines and magazine-pages both MUST be ...
0
votes
1answer
162 views

Custom rewrite after the default term link URL

I have a taxonomy car and a couple terms like kia, honda, and toyota. Using the function get_term_link(), I can get a term archive link like this: site.com/car/honda/ I am trying to use custom ...
0
votes
1answer
44 views

URL rewrite rule

I have taxonomy product_brand and product_cat I have a link: /product_brand/brand_name/?attributes[product_cat]=product_cat_id How to convert to pretty url? /product_brand/brand_name/...
1
vote
0answers
44 views

rewrite url for authors

I have been struggeling with this for a while now and can't seem to get this to work. What i want is the following. I create a custom slug for authors with $slug = sanitize_title( $author->...
1
vote
0answers
158 views

URL redirect/rewrite rule wordpress multisite

I am running wordpress multisite on a server. The main site is working just fine are url redirects are perfect. Say my domain is www.adeel.com and the site is run on following url www.adeel.com/area-...
1
vote
1answer
42 views

Using taxonomy term in CPT permalink – Pages 404's

Having some issues with creating the permalink structure that I'd like. Found a piece of code on Stack Exchange, which unfortunately I cannot locate right now. I have a CPT called project and I want ...
0
votes
0answers
36 views

How to add Search URL parameters to a Page Template Page for Custom Post Type

Scenario: I have a custom post type "book" which the archives are displayed in a page "book-list" using custom page template. Currently, index.php?post_type=book gets redirected to this /book-list/ ...
0
votes
1answer
79 views

Rewrite query var on postname

I'm trying to do a rewrite, so that the query var is going to look pretty: This is the URL structure I got now: example.com/post-type-archive/post-name/?subpage=about This is what I want: example....
0
votes
0answers
41 views

Multiple permalink with and without category for same post

It is a directory site with geodirectory plugin. Site owner wants 2 URLs for every post. One with category and another without category. For example: http://example.com/place/category-name/the-post-...
0
votes
1answer
43 views

Custom Params in URL

Here is the URL I currently Have working : www.Mysite.com?b=ex%2021 I thought I could just add some rules in the .htaccess file, so i added this : RewriteEngine On RewriteRule /b/(.*)/$ index.php?b=...
0
votes
1answer
49 views

Change author base and slug in author link

Hello im trying to change the author link from mysite/author/username to mysite/companies/dataFromUserMetabox i tried the approach from this answer chage author url its working the url changed but ...
1
vote
0answers
19 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
211 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
34 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://...
1
vote
0answers
430 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
34 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%: ...
1
vote
1answer
81 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
1answer
166 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
1answer
202 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
241 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
53 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
44 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
42 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
20 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
503 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
198 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
79 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
37 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. ...
1
vote
1answer
596 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
2answers
20 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
125 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 ...
1
vote
1answer
41 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
1answer
46 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
37 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. ...
1
vote
0answers
91 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
82 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=...
1
vote
2answers
44 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
19 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]', ...

1
3 4
5
6 7
37