Stack Exchange Network

Stack Exchange network consists of 175 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"

0
votes
1answer
6 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 ...
0
votes
0answers
11 views

How to Select post parent for CPT from another post type?

I'm developing a Sports website, covering cricket football, etc. The goal is: .pk /cricket (Landing page) .pk /cricket/ipl (IPL Landing Page) .pk /cricket/ipl/year (IPL Landing Page by ...
0
votes
0answers
42 views

WordPress changes URL on admin page

We have 2 projects. https://host/ - first (on Node.js), https://host/modules/ - second (on WP). Before that nginx stays as reverse-proxy. When I'm on page 'modules', everything is good, but when I go ...
1
vote
2answers
20 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
19 views

Passing URL parameters to WordPress buttons

I'm beginner with programming and web development. I have a WordPress website (http://www.example.com). My post link is http://www.example.com/mypost/, so when I click on a button (assuming demo 1 ...
0
votes
0answers
14 views

Remove Page from title with custom query rewrite

I have a custom query rewrite to accept a numerical parameter (mywp.com/foo/bar/1746). My issue is that the title of the page displays as "MyWP - Page 1746 - Page". Is it possible to change the title ...
-1
votes
0answers
21 views

Seo Friendly URLs without 301 Redirect?

I am trying to create SEO Friendly URLS for my search page. Modify This https://www.example.com/search/?search_text=keyword&category=1 To this: https://www.example.com/search/keyword/?...
0
votes
0answers
17 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
27 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-...
0
votes
0answers
25 views

How to add a custom permalink structure tag?

I'm trying to add a new %taxonomy-name% tag to Custom Structure in /wp-admin/options-permalink.php. I have registered a custom taxonomy called company, and I noticed that I can use a tag named as ...
1
vote
0answers
26 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
40 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
21 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
27 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
46 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
40 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
0answers
20 views

Change url parameter's name with rewrite

¡Hello! I need some help... I get this URL: https://mysite/entrevista-sesion/?Name=pedro And I need to change the parameter's name to: https://mysite/entrevista-sesion/?n=pedro I'm trying to ...
0
votes
1answer
46 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
0answers
14 views

Custom taxonomy in product url

I have a custom taxonomy for products, which i need to set them in product URLs as well. It will be dynamic. so for example This is what i want. https://example.com/taxonomy_value/product_name Right ...
0
votes
1answer
36 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/...
0
votes
0answers
20 views

How to rewrite URL for logged in users?

I'd like to add a word in the URL for logged in users. ie for non logged-in users www.domain.com/abcd and for logged-in users www.domain.com/members/abcd Any idea on how I can achieve this ? Thanks ...
0
votes
0answers
15 views

Url rewriting for wordpress custom page

hi i need some help on my wordpress custom page i try this page show fine and geting data from variable our main post look like example.com/windows/skype i create download page for it which look ...
1
vote
0answers
35 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->...
0
votes
0answers
27 views

Child pages with the same slug

I have an ecommerce website which is running on wordpress and the woocommerce plugin. I sell car accessories and I have some problems with the structure of the sub-category urls and slugs. I tried to ...
1
vote
0answers
32 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-...
0
votes
1answer
20 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
27 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
0answers
16 views

Combine RewriteRule and theme function codes in one simple code

I managed to add an external sitemap to Yoast plugin and it works fine but i need to combine the following code in one simple code (.htaccess file) RewriteRule ^\/?product-sitemap1\.xml$ /ext-sitemap/...
0
votes
1answer
15 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
30 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
29 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
10 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
14 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
42 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
22 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
96 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
22 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
25 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
42 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
36 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
38 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
41 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
22 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
41 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
70 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
24 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
39 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
18 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
47 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/...