Rewrite rules modify a web URL's appearance. This modification is called URL rewriting. Rewritten URLs (sometimes known as short, fancy URLs, search engine friendly - SEF URLs, or slugs) are used to provide shorter and more relevant-looking links to web pages. The technique adds a layer of ...

learn more… | top users | synonyms

0
votes
1answer
808 views

How to test custom rewrite rules /permalinks?

After much research, I think I can wrap my brain around WP's rewrite system. I would like to know, though, how to properly test rewrite rules to see if the right rule/tags is being used and the right ...
0
votes
1answer
710 views

Custom Permalinks for Custom Post Types

I have custom post types registered and they are working fine with their normal URLs. My Custom post types have 'members' as their slug. Now I am trying to have a custom permalink for my custom post ...
0
votes
1answer
38 views

Modifying rewrite rules to use <custom post type>/category/<custom taxonomy term>/

I know I can add a rewrite rule to accomplish this but I'd like to affect the links generated by WordPress (such as when I put a custom taxonomy term into a menu) I have spent the entire day today ...
0
votes
1answer
17 views

Remove rewrite endpoint on deactivation?

I'm using Milo's answer to add a Rewrite Endpoint as part of my plugin. Is there a straight-forward way to remove a Rewrite Rule upon deactivation? I found this snippet but I'd expect a ...
0
votes
2answers
53 views

Best way to redirect site in subdirectory to root?

I have a WP 4.0 site that has been installed at: mydomain.com/site It's been there for many years, so there are lots of links from around the web pointing to it. As part of an overhaul I am doing, ...
0
votes
1answer
35 views

How does WP determine the difference between a post and a page url

I'm trying to mimic WP routing in a javascript plugin. I've successfully imported the rewrite rules and am applying them to the browser location. But I can't seem to parse the difference between a ...
0
votes
1answer
74 views

Custom Endpoint For Custom Post Type from Child Theme

I'm working with a child theme. Main theme has a custom post type called "Place". I need to change that into "Location". However, I changed all levels using wp_post_types object. Now I need to change ...
0
votes
1answer
50 views

Change the custom post type permalink

I have projects category in my theme ( custom post type ). my link goes like this http://shaowtriger.com/project/naim/ my required link is http://shaowtriger.com/brands/naim/ I also ...
0
votes
1answer
46 views

Permalinks using event date (year & month) instead of publication date

The site http://www.bikefun.org is live and working, but the permalinks are not quite right. It is an event calendar site. Events are stored as a custom post type "bf_events", with dates stored as ...
0
votes
1answer
108 views

How do I reset a rewrite?

I made a mistake in writing a previous rewrite in .htaccess. How do I reset it? My home_url = http://basicsourcemassage.ca/bsmassage My site_url = domain name All pages work fine except for the ...
0
votes
1answer
111 views

Using get_query_var() from a plugin

I'm trying to do a redirect feature in a plugin and i have an issue. First, the code: add_action( 'init', function(){ add_rewrite_rule( 'go/([^/]+)/?$', 'index.php?redirect_to=$matches[1]', 'top' ...
0
votes
3answers
73 views

Why isn't my rewrite rule working when there is no second parameter?

Here is my rewrite rule code: add_rewrite_rule('tides/([^/]+)/([^/]*)', 'index.php?page_id=4348&location=$matches[1]&month=$matches[2]', 'top'); add_rewrite_tag('%location%', '([^&]+)'); ...
0
votes
1answer
186 views

WP is ignoring .htaccess rewritten URL

I have two domains being served from the same WP install. edit: not multi-site In wp-config.php I have define('WP_SITEURL', "http://$hostname/wordpress"); etc. The two domains will have similar ...
0
votes
1answer
217 views

Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?

Question updated. What I'm trying to do If I want to display posts (or a feed of posts) that belong to a category AND a custom taxonomy, or a category AND a tag, or a custom taxonomy AND a tag, I ...
0
votes
1answer
135 views

URL rewrite in theme doesn't seem to be working

so I was asked to create url rewrites for one of the websites we're working on, but the thing is the test rewrite I did, just to try it out, is not really working. here's the code I put in the ...
0
votes
1answer
286 views

Permalink/Pagination issue: Category base name same as page name

I currently have a page called "Blog" (slug "blog"), which loads a index.php. All posts in index.php belong to only one post category. A sidebar on index.php contains category links (via ...
0
votes
1answer
787 views

Passing value as hidden parameter to next page

I am trying to send value from one page to another page in WordPress as i do not want to repeat logic to fetch that value in other page. I am not very proficient in WordPress/PHP, if i have to do that ...
0
votes
2answers
368 views

WordPress Rewrite rule is not working

I am trying to create a rewrite rule for one of my custom page and here is the rewrite rule function add_my_rule() { global $wp; $wp->add_query_var('name_state'); ...
0
votes
1answer
165 views

custom post type archive page has 404 error even though has_archive is true

I have an existing site that has a custom post type with no archive. It has been live for almost a year now. I am trying to change the custom post type to have an archive now. So I changed ...
0
votes
1answer
460 views

Redirect URL to an existing page with query string or #! added on

I'm trying to make a photo gallery where the individual photos can be shared on Facebook and Twitter, and when you click the link, the photo that was shared will open in a lightbox automatically. ...
0
votes
1answer
66 views

Wordpress Rewrite Rule

I have a standard page setup at http://mysite.com/mypage/ I'd like to setup a rewrite rule in my theme functions that takes any URLs such as: http://mysite.com/mypage/helloworld/ <-- Currently ...
0
votes
1answer
309 views

Custom page template query_vars

I created a custom page template movie-page.php and a page movie in WP. The template shows fine when I visit site.com/movie/ I want to add movie_id as a query var. Here's my code: ...
0
votes
2answers
251 views

How do I make WordPress revise an .htaccess file a certain way?

I've learned just a slight bit with WordPress Rewrite API -- just enough to add another rewrite rule for a plugin. The plugin works if installed in the root, but I'm finding that if one installs ...
0
votes
1answer
371 views

Tricky URL rewrite with custom values in url

We have custom post type as user_images and each of these post has a image attached with image name is 3 digit number followed by extension. When the url http://mysite.com/wp_username/3digitnumber ...
0
votes
1answer
529 views

.htaccess rewrite

I have created a custom post type called 'event' and added an event called London 2012. I want the following URL structure for a page: local.mysite.com/london-2012/speakers I have created a page ...
0
votes
1answer
184 views

Subpages Permalinks Issues

my site looks like: Page-1 (page.php) ... Subpage-1 (custom-collection.php; Custom Post Type) ...... Filtering Output-Post (custom-collection-single.php) When I open the filtering output-post by ...
0
votes
1answer
40 views

Rewrite rules applied differently after upgrade

After WP upgrade from 3.2.1 to 3.4.1 I faced the problem that rules are not applied same way. I have the following rule: (questions-answers)/([mind|nutrition|fitness|beauty]*)[/page/]*(\d*)$ In WP ...
0
votes
1answer
592 views

Multiple parameters in a custom post type url rewrite

I have a custom post type called venues currently they display through the url format: http://mywebsite.com/venue/{venue-name} I would like to have the format: ...
0
votes
1answer
273 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 ...
0
votes
1answer
555 views

Custom Post Type Date Based Archive URL rewrite [duplicate]

Possible Duplicate: custom post types, wp_get_archives and add_rewrite_rule I have a custom post type called "course" and I would like to create a date based archive similar to the default ...
0
votes
1answer
537 views

Rewrite Rules problem when rule includes homepage slug

I have page Example (ID=443, slug=example) that is configured, through Dashboard->Settings->Reading, as the home page of my WP site. I also have the following rewrite rule configured: ...
0
votes
1answer
40 views

Need Help with Custom ModRewrite

How can I correctly send all traffic from: http://my-domain.com/about/case-studies/clientName/ to http://my-domain.com/about/case-studies/?clientName=$clientName (not seen by visitors) ...
0
votes
1answer
310 views

Keep requested/entered url with add_rewrite_rule

I've got url-rewriting partially working. I have this rule: ...
0
votes
2answers
789 views

Rewrite Rules Are Redirecting and Not Passing VARs

I have the following code in my functions.php file. <?php add_action('init', 'flush_rewrite_rules'); function custom_add_rewrite_rules( $wp_rewrite ) { $new_rules = array( ...
0
votes
1answer
74 views

Leverage WP_Rewrite to pre-validate links / detect invalid links

I'm automatically generating links to (supposed) pages/posts. These links are generated by get_permalink( $post->ID ), so in_theory, should be valid links. Unfortunately, in some situations, where ...
0
votes
1answer
556 views

why is are these rewrite_tags and rules not working?

im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code: function add_video_rewrite () { ...
0
votes
1answer
510 views

Rewrite custom taxonomy slug - but only parent items

I've set up a custom hierarchical taxonomy called 'region'. So now I have e.g. url.com/region/leeds/ etc. However, I'm now expanding to other countries, so I'm making the region sub-categories of ...
0
votes
2answers
422 views

How can I allow trailing slashes on some URLs without a redirect, but not on others?

Here's the scenario. Assume I have a site, wordpress.site, which has the following Permalink structure: /%postname% Assume I then set up the following posts: /post1 /post2 /post3 If someone were ...
0
votes
1answer
621 views

Rewrite loading custom template file but is_home() returns true, and there's no 404

I want to create some custom pages for my theme that don't appear in the Page listing in wp-admin. I have the following class which intercepts the url. class jtvRewrite { var $path = ''; function ...
0
votes
1answer
305 views

Can’t use a specific custom URL (slug)?

I’m having some problems understanding an error I’m getting. I have a page which is called “pitch” and as such the URL and the slug should be “pitch” as well, so: www.my-domain.com/pitch/ But when I ...
0
votes
1answer
631 views

Rewrite rules for custom post type

There is a nonhierarchical custom post type "news". /news/ /news/page/2/ /news/post_slug/ Each post has custom field "views". When someone opens post, field's value increased by one. Would like ...
0
votes
2answers
617 views

Viewing category pages without the word 'category' in URL

When I view a static page its url is like: http://example.com/mybooks/ When I view a category page its url is like: http://example.com/category/books-ebooks/ For SEO, I want some modification so ...
0
votes
1answer
437 views

Custom taxonomy and post type rewrite rules

I'm working on portfolio site, where I need to create a "portfolio" post type and divide posts in it by categories with urls like "/portfolio/category/", so the "category" is the category term. ...
0
votes
1answer
2k views

Rewrite rule that wp-login.php?action=register is left alone

Unfortunately buddypress breaks a facebook connect script because of the rewrite rules. It changes /wp-login.php?action=register into /register/ I tried to find where the custom rewrite rule is ...
0
votes
1answer
139 views

How to Use metada Value in Url and is it possible? [duplicate]

Possible Duplicate: How to use Post Custom Metadata in Post Titles and Post Permalinks hii i want to know that how can i use my metadata value for post url which i add with my every post in ...
0
votes
1answer
47 views

How to link to custom “archive like” page with custom permalink rules “dynamically”

I am working on a plugin where I am trying to create a "archive like" page with permalinks. Here is what I have so far: I've created a query var "experience" I've created custom SQL selects using - ...
0
votes
1answer
577 views

HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?

Hi i am currently writing a WordPress plugin that i want to release to the public. I am having a few issues with URL rewrites however. I have got the plugin to redirect to the plugin page ...
0
votes
3answers
888 views

Pages not appearing?

I've created 6 different custom post types, each with their own archive. I've also created a page with the same name as the custom post type, and a sub-page called 'About' for each. For some reason, ...
0
votes
1answer
417 views

How to do make mysite.com/post-name/sub-post?

I have a small doubt and wonder if I could help. By adding a post, I have the permalink "http://www.mysite.com/post-name". I would like to know how to post a parent, for example, ...
0
votes
1answer
978 views

Taxonomy with_front causes all

I have a custom taxonomy, which sets the with_front to false to try and get the URLs to look like /%type%/%brand%/%product%/, degrading as we go down. This however is driving me nuts. Everything in ...