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
1 answer
364 views

Can I exclude a single URL from a rewrite plugin?

I am working on an imported .html site that has been using the .html on pages plugin to rewrite the URLs for inbound link purposes. Now I am trying to integrate it with a subdomain blog (domain.com/...
Sirmontegu's user avatar
1 vote
3 answers
1k views

Many to Many Taxonomies or rewrite rules?

Im developing a theme for article directory and i would like to link some way taxonomies to taxonomies. I had a custom post type called "company" with 2 taxnomies Taxonomy #1 is category with terms(...
chifliiiii's user avatar
  • 2,842
1 vote
0 answers
81 views

URL rewrite of independent plugin?

I'm currently developing a more complex plugin for WP which can't be hooked up to the WP-API itself (Custom Post Types doesn't fit my requirements). Of course I use the API alot, because the data is ...
Zeus's user avatar
  • 11
0 votes
1 answer
74 views

What approach should I take for this URL structure?

For a website I am developing I have to create two pages with listings of courses. The first page is a "Trainings" page while the other page is "Coaching". I would like to use a single custom post ...
Jan-Henk's user avatar
  • 103
1 vote
1 answer
4k views

How to display only the parent category in the permalink

How it is possible to display only the parent category of the post. It contains two sub categories and I want to eliminate it. Example: myblog.com/parent_category/post_name This is only what I want.
sheena's user avatar
  • 21
2 votes
5 answers
9k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
unfulvio's user avatar
  • 1,814
0 votes
1 answer
13k views

how to create several url aliases for a page

on the root page of a WordPress site we have a custom page template, that also handles some forms and dynamically changes part of the content. Something like this: <form action="" method="post"&...
memical's user avatar
  • 123
1 vote
2 answers
4k views

wp_list_categories() - current-cat class also inside posts?

I wrote my own function to list all taxonomy terms of a certain taxonomy … function wr_list_taxonomy($taxonomy, $orderby, $hierarchical) { $show_count = 0; $pad_counts = 0; $title ...
mathiregister's user avatar
1 vote
1 answer
177 views

add_rewrite_rule behaving strangely

I'm customizing another plugin by changing the rewrite rule, from: add_rewrite_rule('^api/auth/([0-9]+)?/?','index.php?__api=1&uid=$matches[1]','top'); to: add_rewrite_rule('^api/auth/'...
emersonthis's user avatar
  • 1,327
1 vote
1 answer
1k views

Rewrite rule for a query string

I have a taxonomy search form and the link output is http://localhost/wp/?cityid=16 But i want it to be rewrited as http://localhost/wp/cityid/16 .htaccess # BEGIN WordPress <IfModule ...
Adige72's user avatar
  • 71
0 votes
2 answers
1k views

Using WP Rewrite to rewrite custom urls in this scenario

I have build a plugin where I can output special php pages on a page using shortcode. The plugin directory consists of the following php pages. product_info.php index.php account.php login.php ...
Ken's user avatar
  • 369
2 votes
1 answer
3k views

Multilingual theme: Changing locale based on URL

I'm developing a multilangual theme. I use the __() function for translation, which works just fine. The main language is English, but the second language is German. For that second language, I'd like ...
lupor's user avatar
  • 58
4 votes
2 answers
15k views

How do I create a dynamic page?

I want to create something similar to what buddypress does with member pages. For eg; http://www.example.com/members/foo http://www.example.com/members/bar etc. I tried looking up the buddypress ...
Deepak Mittal's user avatar
-1 votes
1 answer
116 views

Generated URLs don't reflect accurate URLs.

Evening, I'm getting some incorrect links generated by my theme. WordPress Address (URL): http://localhost/newgameplus/wordpress Site Address (URL): http://localhost/newgameplus Clicking on ...
Adola's user avatar
  • 5
12 votes
3 answers
16k views

Add .html (dot HTML) extension to custom post types

Is there any way to add the .html extension to custom post types without plugin ? For posts I can use /%postname.html on the permalink settings For pages I can use: add_action('init', '...
user983248's user avatar
  • 1,350
24 votes
4 answers
18k views

How to create a front end user profile with a friendly permalink

I want to create a public front-end profile page with a friendly url like this format. mysite.com/user/someusername Any idea on how can i achieve this? I know it has something to do with rewrite ...
tiltdown's user avatar
  • 444
2 votes
1 answer
95 views

Is it possible to rewrite URLs in this situation?

I am using a fantastic plugin called Query Multiple Taxonomies which provides a widget to "drill down" by category / tag and other custom taxonomies you may have. The site is livetonom.com. The ...
Steve's user avatar
  • 153
6 votes
4 answers
17k views

Including category-base in a post permalink results in 404

I have static front-page and separate page /news/ as the Posts page. I would like to have the single-post URLs like this: www.example.com/news/categoryname/subcategory/postname/ and for the category ...
semyonfilippov's user avatar
1 vote
0 answers
71 views

ngnix Url rewrite doesn't work

on my server i have installed magento,which is in my root directory. then I created a sub-folder named blog in my site's server. access the blog url is: http://example.com/blog http://example.com/...
user1188320's user avatar
3 votes
0 answers
395 views

Evaluating a external rewrite rule before internal wordpress rewrite rule

I am been plucking out my hairs since last few days trying to solve this problem: I want to convert my urls from format http://example.com/prodsearch/category/tag1-tag2-tag3-tag4 to http://...
scientist.rahul's user avatar
3 votes
1 answer
78 views

When to use which plugin output method?

I'm a Drupal dev, getting into Wordpress. So far as I can tell there are a few different methods by which a plugin can output content on to a Wordpress site: Shortcode Rewrite API Widget API "...
m4olivei's user avatar
  • 133
3 votes
1 answer
285 views

How to create custom URLs for Custom Post Type sub sections?

Not sure how to ask this, because I'm not exactly sure what I'm asking. I'm looking to use custom URLs (using rewrite rules maybe?) to create 'tabs' for a Custom Post Type. In the past I've used ...
Tyrun's user avatar
  • 102
8 votes
1 answer
4k views

How to remove dates from existing permalinks?

After doing some research about dates on blogs, it seems like it is a good idea to remove them from the existing posts. Consider: Self-hosted (on Bluehost) Over 1,000 existing posts All posts are ...
B Seven's user avatar
  • 281
0 votes
1 answer
614 views

wp_rewrite not working on third level url

I have the following code : global $wp; $wp->add_query_var('akey'); $wp->add_query_var('sort'); $wp->add_query_var('paged'); add_rewrite_rule('^activate/([^/]*...
Paul Dumitru's user avatar
1 vote
0 answers
410 views

IIRF + IIS 6 + Wordpress does not return 404 error

I use IIRF for Wordpress redirects in IIS6, but does not return "Page not found" (404), always redirect to home directory for all missing files. Permalink Structure: /%postname%.html IIRF rewrite: ...
Fernando JS's user avatar
17 votes
4 answers
27k views

Change the "page" slug in pagination

Simple question. When pagination is activated, the URL changes to "site.com/page/2". For my site, this should be "site.com/paggetto/2". How can I change that rewrite rule? I also want to change "...
DarkGhostHunter's user avatar
1 vote
2 answers
1k views

Get url-friendly version of the_title?

How can I get an url-friendly version of the post_title? I´m using anchor links for my posts on an archive page, and for the moment the posts get the post_ID as a hash tag but I would like to get the ...
Johan Dahl's user avatar
  • 1,343
1 vote
1 answer
519 views

How to remove parent section from attachment URL?

I have buddypress installed. All URL goes under BP's URL structure. If an attachment belongs to a document in a group, the URL is: http://domain.com/groups/group-name/docs/doc-name/attachment-name I ...
Jenny's user avatar
  • 1,757
4 votes
2 answers
555 views

How to seamlessly redirect between different archive and singular slugs?

I have a CPT with slug function (singular) and archive slug functions (plural). Permalink structure for: singular is /function/[postname]/ archive is /functions/[page-x/]. (can poke live at ...
Rarst's user avatar
  • 99.7k
3 votes
1 answer
6k views

Remove parent slug for child pages

I'm looking for a plugin/custom function that removes the parent slug of a child's page permalink. Something that automatically changes the permalink for child pages. Example: www.blog.com/products/...
INT's user avatar
  • 1,281
3 votes
1 answer
324 views

Removing rules from .htaccess

I'm writing a small plugin that needs to write to .htaccess a simple non_wp_rule and i am doing it like this: function ci_flush_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } ...
tsiger's user avatar
  • 141
1 vote
1 answer
970 views

Custom Post Types, URL rewrite on multiple CPTs

Re: Custom post types, taxonomies, and permalinks by @TheDeadMechanic The solution above works perfectly, and rewrite is great, but can you advise on how to rewrite for more than one custom post type ...
scampi's user avatar
  • 11
0 votes
2 answers
1k views

custom wordpress rewrite

I am trying custom rewrite for following url... http://www.domain.com/lp/1 and it would be parsed using lp.php?p=1 I have tried following... add_action( 'init', 'aagt_rewrite_add_rewrites' ); ...
seoppc's user avatar
  • 165
0 votes
1 answer
2k views

i want to rewrite my custom plugin url

I am Working on wordpress plugin. and i have a form like this $action_url = WP_PLUGIN_URL .'/demo-url-rewrite/include/test.php'; <form action="<?php echo $action_url; ?>" method="get"...
Pranav Gandhi's user avatar
0 votes
2 answers
2k views

add_rewrite_rule and template redirect not working

I have the following pairs: add_rewrite_rule('^questions/ask/?','index.php?pagename=ask','top'); if(is_page('ask')){ $tname = 'add-question.php'; if(file_exists(TEMPLATEPATH.'/'.$...
Paul Dumitru's user avatar
0 votes
2 answers
484 views

Category URL Management

When you keep the category base ( that is you don't remove it by a plug in) WordPress does allow you to browse to your 2 level deep category in two different ways as the example below would ...
Average Joe's user avatar
  • 1,879
3 votes
1 answer
4k views

Permalink rewrite with custom post type and custom taxonomy

I think thats a quick one: I've got: Custom post type: Food Custom taxonomy (Registered to Food): Fruits Terms in Fruits: Apple, Orange, Cherry If I type in example.com/food?fruits=Apple,Cherry, I ...
dee's user avatar
  • 33
0 votes
1 answer
1k views

Rewrite rules for using the same base slug for multiple content types

I'm not sure if this is possible or not, but here is what I'm trying to achieve. I'm using WooCommerce, and I have it setup to prepend a base slug and the product category to my product permalinks. So,...
Dominic P's user avatar
  • 685
0 votes
1 answer
117 views

Wordpress redirection to get url friendly

I want to get url friendly for pass data to page from other page. I explain : I have on i classic wordpress page, url like it : ( example.com/agent/name_agent ) it's url build dynamically. ( ...
Vincent Guesné's user avatar
0 votes
1 answer
449 views

Why wp redirects me to wp-login.php when I visit a rewritten wp-admin URL?

I have this rewrite rule ^dashboard(.*) wp-admin$1 [L] and wp redirects me to wp-login.php when I try to visit /dashboard (even if I am logged in) Any idea why this happen, and how I can solve ...
G.G.'s user avatar
  • 101
12 votes
2 answers
5k views

Permalink format: singular or plural

The default is singular, e.g. http://example.com/category/apple/ But I am wondering if it is better to use the plural form, e.g. http://example.com/categories/apple/ Are there any guideline on ...
Yoga's user avatar
  • 899
41 votes
2 answers
163k views

Custom Post Type URL Rewriting?

I setup a custom post type for my portfolio projects. The main URL for this is located at /projects/ Now I've also setup my blog posts permalink to /articles/*/ for the permalink structure. This ...
Jake's user avatar
  • 540
0 votes
1 answer
201 views

How can i maintain permalink structure and avoid a 404 error when loading external content?

I created a page called Catalog and also a template called page-catalog.php. The url looks like this now: sitename.com/catalog So far so good, however i use some custom php stuff to list products ...
passatgt's user avatar
  • 3,338
0 votes
1 answer
69 views

rewrite file to wordpress

I have in my plugin dir a endpoint.php and need to rewrite like this: http://domain.com/API/endpoint.php This is the code I've used: add_rewrite_rule( 'API/endpoint.php', 'myplugin-path/endpoint....
greenbandit's user avatar
4 votes
3 answers
5k views

add_rewrite_rule not loading correct page nor getting variables

I've trying to get a showreel title and video id into an URL that can then be accessed by the page. i have the two in the same URL and it either doesn't work or only one comes in. Currently the page ...
v3nt's user avatar
  • 1,669
2 votes
1 answer
3k views

Sorting Posts Via Custom Taxonomy Values Using Checkboxes?

I am working on a project that has a dropdown of custom taxonomy values called "Disciplines", there are only 4 of them in the dropdown. The way it has been designed is that you can select more than ...
Dwayne Charrington's user avatar
3 votes
2 answers
20k views

Slug for custom post type archive

I created a new custom post type 'Projects' and want the archive of all posts of this type to be available at mysite.com/projects. At the moment all project single posts are shown with a slug as ...
urok93's user avatar
  • 4,024
1 vote
1 answer
391 views

Rewrite ugly URL to clean URL

Im trying to go from: http://www.example.com/product?level1=value1&level2=value2&level3=value3&level4=value4 To: http://www.example.com/product/value1/value2/value3/value4 Sometimes ...
Patrick's user avatar
  • 11
5 votes
3 answers
2k views

How to add a custom URL placeholder to author archives?

I am working with a client who has a directory site that allows users to create accounts, then lists of items from the directory. Right now, whenever a user creates an account, she gets a profile URL ...
james's user avatar
  • 51
0 votes
1 answer
3k views

Custom Taxonomy Archive URL rewrite

I would like to create an archive page with a list of my custom taxonomies that link to a page that shows posts with that taxonomy relationship. I registered my taxonomy like this: register_taxonomy(...
Mike's user avatar
  • 813

1
33 34
35
36 37
41