Refers to the process whereby an URL is manipulated to create what in WordPress is called a "pretty permalink"
20
votes
1answer
5k views
A tool to analyze rewrite rules? [closed]
Is there a good tool to analyze my rewrite rules? I always get confused with the regexes and the parameter replacements.
I have created something myself and will post it here so others can use it, ...
13
votes
1answer
9k views
Need help with add_rewrite_rule
SOLUTION
I've gone with Update 3 and have got it working. What I had misunderstood, was that I believed that a rewrite rule would change designers/?designer=some-designer&bid=9 to ...
12
votes
7answers
7k views
How do you create a “virtual” page in WordPress
I'm trying to create a custom API endpoint in WordPress, and I need to redirect requests to a virtual page in the root of WordPress to an actual page that ships with my plug-in. So basically, all ...
12
votes
2answers
5k views
Mixing custom post type and taxonomy rewrite structures?
Basically I want to achieve a glossary using custom post types and have some issues setting up rewrites the way I want them to be. I want it like that:
The main glossary URL:
...
8
votes
4answers
969 views
Remove custom post type slug from URL
Haven't found a useful answer for this. I am aware of the conflict issues and all the problems this may cause, I'm curious if it's POSSIBLE not SUGGESTED. This will require WP rewrites, I know this ...
8
votes
3answers
698 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 ...
8
votes
3answers
3k views
WordPress Rewrite Rules for Custom Post Type and Taxonomy
I have found this place to be a good source of information in the past through a lot of Googling for the problems I have run into. My question pertains to the verbose rewrite rules WordPress uses.
I ...
7
votes
1answer
2k views
custom taxonomy and pages rewrite slug conflict gives 404
I'm using the Custom Post Type UI plugin to create my custom taxonomies. I have a portfolio that is made up of projects (custom post type) with 2 custom taxonomies of technologies and clients. The ...
6
votes
1answer
4k views
How to create custom URL routes?
I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
6
votes
1answer
471 views
Does WordPress keep track of a post's URL history and provide automatic redirects?
I just changed the URL of one of my posts from
http://2011.denmark.wordcamp.org/session/theme-frameworks-trends-og-standardisering/
to
...
6
votes
1answer
186 views
Using the Rewrite API to Construct a RESTful URL
I'm trying to generate rewrite rules for a RESTful API. I just want to see if there is a better way to make this work than having to write out every possible rewrite combination.
Ok so I have 4 ...
6
votes
1answer
122 views
Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?
I am running a site for a German NGO under the domain sub.example.org.
Recently, I added sub.example.ch for its Swiss spin-off.
Both (sub-)domains are pointing to the same physical location, a WP ...
6
votes
3answers
779 views
Pretty URLs for File Uploads?
Can files such as PDFs be uploaded to custom URLs? I would like to upload a PDF to www.example.com/whitepapers/pdf.pdf instead of www.example.com/wp-uploads/....
I found a plugin called WP Easy ...
6
votes
1answer
2k views
Pretty permalinks for search results with extra query var
I'd like to know how I can rewrite a search URL that also contains an extra query var into a pretty permalink using wp_redirect and the template_redirect hook.
I have taken the code from the Nice ...
6
votes
2answers
313 views
Problem with add_rewrite_rule and pagination (paged and page query_vars)
I have a custom taxonomy named location and I want to add sections like 'news' and 'marketplace' for each term, so my url looks like /location/montreal/news/
It works perfectly until I try to add ...
5
votes
2answers
419 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 ...
5
votes
3answers
2k views
Masking wp-content/themes/name/images to just images directory using htaccess
I'm trying what I thought would be something really simple of masking my url but cannot seem to get it to work. I want to be able to link to images in my img tag without having to type in the full ...
5
votes
1answer
6k views
Passing and retrieving query vars in wordpress
I have two authors pages, one displays about 5 posts. Then I'm trying to setup another page that will be all of their posts. I have created a template called moreauthorposts.php and I'm trying to ...
5
votes
2answers
860 views
How does WordPress handle permalinks?
WordPress auto corrects the permalinks(URLs) even if it is entered incorrectly. For e.g. WordPress will land you in example.com/some-post even if you enter example.com/idontexist/some-post or even ...
5
votes
3answers
3k views
Custom permalinks with NextGEN Gallery
i set my wordpress permlink to /%category%/%postname% now i'm using Nextgen Gallery so when i have a gallery in a page it will be something like /cat/page?gallery=10 i want to make it something like ...
5
votes
1answer
154 views
Date based URLs for custom posts and pagination
I have created a custom permalink structure for a custom post type (events) using the code below:
$GLOBALS["wp"]->add_query_var("event_year");
$GLOBALS["wp"]->add_query_var("event_monthnum");
...
5
votes
1answer
224 views
Custom post type yearly/ monthly archive permalinks
I have a custom post type "news" in my Wordpress site. I am using Advanced Custom Fields plugin to add meta data to each post.
I want to create an array of news items as an archive:
[2013]
...
5
votes
1answer
224 views
Clash of the rewrites
I have a category called 'neighborhoods'. I also have child categories within 'neighborhoods' E.G. Lakewood, Highland Park...
When I click 'highland park' the url is ...
5
votes
3answers
538 views
How-to add rewrite rules to point the uploads folder to a subdomain
The goal Point the upload-folder to a static subdomain to serve adaptive images, that can get cached.
WordPress Rewrite Rules
You can read more in detail about rewrite rules API at Christopher Davis ...
5
votes
1answer
2k views
How can I rewrite URLs to pass taxonomy and post type values to the query?
So I have a site with about 6 custom post types.Three of these post types are attached to a single custom taxonomy.
I would like to be able to list_cats in the sidebar and spit out a url like ...
4
votes
2answers
1k 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 ...
4
votes
2answers
1k views
Override default url for author pages?
So the default url to display a list of posts by a particular author looks like this:
http://domain.com/author/{username}
I am wondering how to change the 'author' in that url to something else?
I ...
4
votes
3answers
1k 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', ...
4
votes
2answers
4k 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 ...
4
votes
2answers
149 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 ...
4
votes
1answer
245 views
How do I add a server-independent external rewrite rule?
External rewrite rules are awesome. They let you define rewrites that don't necessarily pass through WordPress' index.php. This means you can map arbitrary rules to arbitrary files like:
...
4
votes
1answer
164 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 ...
4
votes
1answer
209 views
Add forward slash on categories url (serve one version of a url)
How can I a add forward slash on categories URLs and serve only that version of a category (meaning URLs not ending in forward-slash will redirect to URLs ending in forward slash).
I manage to remove ...
4
votes
3answers
496 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 ...
4
votes
2answers
4k views
How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
I'm using Wordpress 3.1.3 as a full CMS, installed in the root directory of a domain. I have it setup using the built in options to have a static page as the home page, and then my blog at ...
4
votes
3answers
952 views
Using /%postname% for a custom post type
I have a custom post type whose permalink needs to sit in the same space as pages, like so:
/an-example-thing <-- custom post type 'thing'
/about-the-things <-- a normal page
I'm well ...
4
votes
1answer
605 views
How to filter custom post type archive by meta value
I have a problem where I'm trying to build a calendar plugin for a client. I'm having trouble getting a date based archive for the custom post type I'm using. I'm not too well versed in how the ...
4
votes
0answers
112 views
Permalinks so that one custom post type appears to be a child of another, not working
Currently I have two post types, "products" and "products-data" they are separate post types; however, for all intents and purposes products-data is a child post of products. The relation is ...
4
votes
0answers
92 views
Restrict url to one segment, even when page or post is nested [duplicate]
I use nested/hierarchic pages purely for organizational purposes in the admin but on the main site I don't want a nested url structure. So if the page structure is /page/another-page/and-another-page, ...
4
votes
1answer
298 views
Custom post types with their own permalink structure
My main posts are news items (category "news"). Therefore, I used global URI writing in the following format: /year/month/post-name
I also have posts that contain photo albums (category "photo") but ...
4
votes
3answers
309 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 ...
3
votes
4answers
1k views
Relative URLs and hide /wp-content/themes/
in my header and other sections I would like to use
<script src="/incs/js/script.js"></script>
While maintaining the default theme folder structure in server as below
...
3
votes
3answers
878 views
Force the Website URL to Include “www” and to be Upper Case?
No matter what url somebody uses to access my site, I'd like it to redirect to www.MyUrl.com. Is this possible?
3
votes
3answers
170 views
rewrite_rule() not preserving the query string
We have added a custom rewrite_rule to our site to allow for a pretty inbound link to be parsed and handled properly. Links are constructed as domain.com/meetings/faculty/someIDnumber
add_action( ...
3
votes
1answer
2k views
Custom post type, no need for single view, plus want permalink rewrites that include hash in URI
We are using CPT's to manage a frequently asked questions page on a site, where the question is the post title and the answer is the post content. There is a main page for the FAQs that shows all ...
3
votes
3answers
2k views
Need help with rewrite_rules_array
I have a page that I access at /category/tasks and the file is located at wp-content/themes/my-theme/tasks.php. I would like to make it so I can add a flag after tasks and pick up the query strong in ...
3
votes
1answer
1k views
Pretty URL with add_query_var
I'm trying to add a 'sub post' to each post on my site, eg
site.com/product-one/changelog
site.com/product-two/changelog
site.com/product-three/changelog
This is the code I'm using atm, which I ...
3
votes
3answers
435 views
Custom permalinks
We have a custom type music.
/music/
/music/post-name/
Also, we have a tag-like taxonomy genres. Its urls are:
/music-genres/genre-name/
I'm trying to make urls like:
/music/
/music/post-name/
...
3
votes
1answer
1k views
Add Rewrite Rule for custom page
Was trying to create author specific page with author specific URL and it was working fine,but when i created this URL did not taken in to account following 2 factors
Author Name Conflict (similar ...
3
votes
1answer
1k views
URL rewrite rules for multiple taxonomies query
I'm trying to create some pretty URLs for links querying multiple taxonomies. I'm using the "Taxonomy drill-down" plugin, although the main usage is now integrated @ the core it still has some helpful ...
