Two Rewrite Rules
Catch those requests before WordPress can see them: RewriteEngine On RewriteBase / RewriteRule ^link/(\d+)$ /links/index.php?link=$1 [L,QSA] Place the WordPress rules below the link rules.
Catch those requests before WordPress can see them: RewriteEngine On RewriteBase / RewriteRule ^link/(\d+)$ /links/index.php?link=$1 [L,QSA] Place the WordPress rules below the link rules.
Go to Settings->Permalinks Add this to Custom Structure: /%postname%/ Update WordPress generates .htaccess-files for this. Just go to your root and activate the show invisable files on your computer. Here is the htaccess for the structure: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d … Read more
Try this code: add_filter( ‘query_vars’, ‘my_query_vars’ ); function my_query_vars( $vars ) { $vars[] = ‘catname’; return $vars; } add_action( ‘generate_rewrite_rules’, ‘my_rewrite_rules’ ); function my_rewrite_rules( $wp_rewrite ) { $products_page_id = 1; //your product’s page ID $wp_rewrite->rules = array( ‘products/?([0-9]{1,})/?$’ => $wp_rewrite->index . ‘?page_id=’.$products_page_id.’&paged=’ . $wp_rewrite->preg_index( 1 ), ‘products/(.+?)/?([0-9]{1,})/?$’ => $wp_rewrite->index . ‘?page_id=’.$products_page_id.’&catname=”.$wp_rewrite->preg_index( 1 ).”&paged=’ . $wp_rewrite->preg_index( … Read more
You could add the path via add_rewrite_endpoint, then alter the query via the pre_get_posts action. Here’s a proof-of-concept example that alters the posts_per_page when domain.com/highest-rated/ is requested: // add the endpoint function wpa85664_add_endpoint(){ add_rewrite_endpoint( ‘highest-rated’, EP_ALL ); } add_action( ‘init’, ‘wpa85664_add_endpoint’ ); // check if the endpoint is in the current request // and alter … Read more
For this kind of rewriting, I’m using this code (haven’t tested this one exactly, so may contain minor bugs): add_filter( ‘query_vars’, ‘binda_query_vars’ ); function binda_query_vars( $vars ) { $vars[] = ‘pp’; return $vars; } add_action( ‘generate_rewrite_rules’, ‘binda_rewrite_rules’ ); function binda_rewrite_rules( $wp_rewrite ) { $wp_rewrite->rules = array( ‘news/([0-9]{1,})/([0-9]{1,})/?$’ => $wp_rewrite->index . ‘?post_type=news’ . ‘&pp=’ . $wp_rewrite->preg_index( … Read more
Have a look at the Permalink settings in the admin, you should be able to achieve what you want there. Here is a link to the Permalink Codex something like /%post_id% should do the job, if you select the ‘Custom Structure’ option.
I did not test this, but the following should do what you want (which is not really WP-specific, BTW): RewriteEngine On RewriteBase /wp-content/plugins/ RewriteRule (.*) http://cdn.mysite.com/wp-content/plugins/$1 [L,R=301]
You could do something like this to rewrite rules for author titles, check out the monkeyman rewrite analyzer to figure out, following code should be in your functions.php add_filter(‘rewrite_rules_array’, ‘my_insert_rewrite_rules’); function my_insert_rewrite_rules($rules) { // Implement this function to add all the new rules to $rules array passed in $newrules = array(); $authors=get_users();//http://codex.wordpress.org/Function_Reference/get_users foreach($authors as $author) … Read more
You can try these rules: reviews/([^/]+)/page/?([0-9]{1,})/?$ reviews/([^/]+)/?$ It’s informative to check out the active rewrite rules with: function show_rewrite_rules( $rules ) { if(is_admin()) echo “<pre>”.print_r($rules,true).”</pre>”; return $rules; } add_filter(‘rewrite_rules_array’,’show_rewrite_rules’); and then visit /wp-admin/options-permalink.php. There exists also some good plugins for analysing the rewrite rules, for example the Monkeyman Rewrite Analyzer.
You need to use your page id of “People” page. If i assume it is 12 then this will do, add_rewrite_rule(‘^people/([^/]*)/?’,’index.php?page_id=12&name=$matches[1]’,’top’);