The rewrite-rules tag has no wiki summary.
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 ...
0
votes
1answer
67 views
Wordpress Rewrite Rules
I created the page template which needs to take some GET variables, currently URL's looks like that:
http://example.com/coupons/?cat_id=25
I need to make that way:
http://example.com/coupons/25
I ...
0
votes
1answer
627 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; ?>" ...
2
votes
1answer
721 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, ...
1
vote
1answer
262 views
All pages after level 1 showing 404 after WordPress migration plugin - how to fix?
I am in the process of moving my blog away from GoDaddy (yey!) to HostGator. I used the migration plugin on GoDaddy tat created the gz archive of the database, and I copied all my files over to the ...
0
votes
1answer
115 views
Problems with rewrite rule
I realy cant to figure this out.
What i want to do, is this URI http://www.hotels-lithuania.net/index.php?page=76&type=hotels&id=1 transform to http://www.hotels-lithuania.net/item/hotels/1.
...
0
votes
1answer
206 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 ...
3
votes
1answer
156 views
Modify custom post type rewrite rules in a separate function
I want to modify the rewrite rules for a custom post type, tribe_events, which is registered as a post type within "The Events Calendar" core plugin files (the-events-calendar.class line 24):
...
0
votes
1answer
188 views
Custom Post Type Rewrite To Include Parent Page(s)
I have a page title "more" with subpage "cities-guide". Said "cities guide" page has a loop that pulls in posts from custom post type "thailife_city_guide".
My permalink structure is ...
1
vote
1answer
107 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 ...
4
votes
3answers
311 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 ...
0
votes
1answer
101 views
New rewrite rules for custom taxonomy and reuse default
I have a taxonomy location. All terms except one are to be treated differently. That's why I have two php files
taxonomy-location.php
taxonomy-location-national.php
Now, I want to make the URLs ...
0
votes
1answer
227 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
297 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
2answers
186 views
Help with url rewrite
How can I turn a URL like:
http://site.com/?project=5
into:
http://site.com/project/5/
?
I was looking the rewrite doc here:
http://codex.wordpress.org/Class_Reference/WP_Rewrite#Examples
and ...
4
votes
1answer
752 views
add_rewrite_rule() vs $wp_rewrite->rules vs 'rewrite_rules_array'?
I've written Rewrite rules for my custom post types. they work well except that WP doesn't update the url in the User Agent when the redirect_url doesn't match the requested_url.
everything else ...
1
vote
1answer
293 views
Does WP Have a Function To Generate .htaccess RewriteCond?
I know that I can edit .htaccess manually and add a RewriteCond statement inside, but I need to build a plugin that does this the proper way by using WP rewrites which then get pushed into .htaccess ...
0
votes
1answer
166 views
Rewrite /category/cars into /topics/cars
I know there are plenty of question and posts about this out there, however I couldn't find a solution or existing thread to my specific question.
If I list my categories and click on "cars" the url ...
2
votes
3answers
300 views
flexible rewrite 'ramble' URLs with Wordpress
I want to access my post with id 17 like this:
http://localhost/archives/17/moot-bla-foo-ramble
In other words, the id shall decide, everything thereafter may (or may not) be the slug or anything ...
0
votes
1answer
38 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)
...
1
vote
1answer
207 views
How To Consistently Enforce Rewrite Rule in Plugin Development
Let's say I create a customer support plugin that hijacks the /support part of the URL and redirects it to an MVC framework in my app folder of my plugin folder, like so:
RewriteRule ^support(.*)$ ...
1
vote
1answer
191 views
Best structure / rewrite rules to achieve the following url
I have been trying to achieve the following url structure in Wordpress and maintain a level of reusability in the admin area.
It is for a client preview area and needs to reflect multiple versions of ...
0
votes
2answers
709 views
Rewrite-Rules not working on a vhost, everything goes to index.php
after setting up the wordpress htaccess rules in my vhost, i was unable to enter the wp-admin area. I was always redirected to the frontpage of my wordpress instance.
The rewriting itself worked on ...
4
votes
1answer
220 views
Custom Rewrite Rules Not Sticking
I've written some custom rewrite rules for a special feature on http://www.pewhispanic.org/states/. States is a page with a custom page template, page-states.php. The logic for returning the right ...
1
vote
1answer
536 views
Auto generate rewrite rules for multiple taxonomies
so i'm back with rewrites... i am looking for a more automated solution.
i stumbled across this on the interwebs:
/**
* Generates all the rewrite rules for a given post type.
*
* The rewrite ...
1
vote
1answer
85 views
custom template rewrite
I have a page called my-todo-list and is using a custom page template.
The page is accessible via this type of URL : http://domain.com/my-todo-list/
Now I need to paginate it, and I want to look ...
1
vote
3answers
497 views
Custom Post Types: pretty search URLs and has_archive
This is a question based on the comments from the answer here.
I'm using the following code to create a couple of different search boxes for my website:
<form action="<?php echo home_url( ...
6
votes
0answers
409 views
add_rewrite_endpoint() not working for custom post type archives [closed]
i'm working on somekind of wiki/encyclopedia system based on wordpress.
there are two custom post types. i'll show my configuration for one of them:
$labels = array(
'name' => _x('Objects', ...
2
votes
2answers
1k views
Rewrite Rules for Multiple (more than 2) Taxonomies
I am using woocommerce and have some 'product attributes' which are just a taxonomies.
I have the following taxonomies:
pa_color
pa_material
pa_style
the pa_ stands for product attribute and it ...
0
votes
1answer
187 views
Keep requested/entered url with add_rewrite_rule
I've got url-rewriting partially working. I have this rule:
...
1
vote
2answers
418 views
Customising rewrite rules for CPT single post URL to work as paged URL
I've got a CPT called Service registered as following:
$args = array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'has_archive' => false,
...
0
votes
1answer
237 views
add_rewrite_rule not added to htaccess when index.php is used in rewrite rule [closed]
I'm trying to add some rewrite rules to a plugin that is supposed to redirect to different urls, basically rotates through urls I add in the admin.
Example: The plugin creates ...
2
votes
1answer
624 views
How to rewrite custom post type with custom taxonomy urls?
I am working in a WP multisite which runs on a classipress theme and there is a custom post type "ad_listing" and custom taxonomy type "ad_cat". Now the url is like this
...
5
votes
3answers
541 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 ...
0
votes
2answers
349 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
945 views
Custom post type permalink endpoint
I have a custom post type called "destinations" and I have set the EP mask for the post type to default EP_PERMALINK. I have added a couple of endpoints as follows :
add_filter( 'query_vars', ...
1
vote
1answer
174 views
Can't add external rewrites
I've got the following code in my functions.php
function add_custom_rewrite_rules(){
add_rewrite_tag('%gallery%','([^/]+)', 'gallery=');
add_rewrite_tag('%album%','([^/]+)', 'album=');
...
1
vote
1answer
788 views
Rewrite wp-login.php URLS to static pages?
I'm struggling with getting a few things in WP to redirect.
I'm using a front-end profile / profile editor, and I'm also using a front-end login/register.
Naturally I would like to redirect the ...
2
votes
1answer
376 views
add_rewrite_rule not producing anything in $_GET
Trying to get pretty permalinks happening for a plugin that displays events
I have this:
function my_add_rewrite_rules() {
global $wpdb;
$org_options = get_option('event_settings');
// ...
0
votes
1answer
71 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 ...
1
vote
3answers
248 views
Making extra parameters optional
I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit:
add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', ...
3
votes
0answers
59 views
Add /demo/ slug with rewrite rule [duplicate]
Possible Duplicate:
Add extra parameters after permalink?
I need to add a slug to every post.
Current permalinks
http://www.my-domain.com/2012/01/01/my-post-title/ or
...
0
votes
1answer
330 views
custom rewrite rules causing unmatched parentheses at offset error [closed]
alright so i have these custom rewrite rules in functions.php that work fine:
function add_video_rewrite ()
{
add_rewrite_tag("%video_id%", '([^/]*)');
add_rewrite_tag("%video_slug%", ...
0
votes
1answer
271 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
98 views
help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]
Possible Duplicate:
custom htaccess rewrite rule for page
ok i made another post and i got pointed to the Rewrite API
however, when i do print_r($_GET) on the page, it echos an empty array
...
1
vote
0answers
96 views
How do I write a custom API endpoint that accepts args and passes them into a function? [closed]
I'm writing my first WP plugin and feeling pretty lost. This should be a simple issue, but I can't seem to find any good tutorials or anything.
Here's some code I've cobbled together from various ...
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 ...
2
votes
2answers
1k views
Clean URLs for custom $_GET variables
I have a query var show=othertemplate that I can add to any URL to show any post, page or archive in Wordpress in a different template, like this: mysite.com/[any URL]/?show=othertemplate. I'd like ...
0
votes
1answer
378 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
1answer
908 views
add_rewrite_rule again
In general, the code from this question fit to me for 90%. One little change I need - I want all URL like *example.com/snpv/any_text/* direct not to index.php as in original code, but to my.php script ...
