You don’t have to touch the Apache configuration for this, you can do this all from the WordPress rewrite system. But indeed, your general idea is correct: you should append ?cat=3
(or category_name=blog
if you want to be even clearer). Remember that your blog archive can have multiple pages, maybe you want to handle this too.
This is how I would do this from inside WordPress:
add_action( 'init', 'wpse7379_init' );
function wpse7379_init()
{
add_rewrite_rule(
'blog(/page/([0-9]+))?/?$',
'index.php?category_name=blog&paged=$matches[2]',
'top'
);
}
Related Posts:
- How to create custom URL routes?
- Masking wp-content/themes/name/images to just images directory using htaccess
- How to change default page slug?
- Mod_rewrite delete parameter in 301 Redirect
- Sub domain redirection to taxonomy
- Need to make a php file inside theme accessible via url
- Evaluating a external rewrite rule before internal wordpress rewrite rule
- Rewrite rule to load images from production does nothing
- Rewrite Rules Are Redirecting and Not Passing VARs
- WordPress rewrite rules don’t need ^?
- Adding rewrite rules directly to .htaccess file
- Custom rewrite not working
- WP is ignoring .htaccess rewritten URL
- a one-off rewrite rule
- Rewrite wp-login.php URLS to static pages?
- Need help with simple rewrite rule (shouldn’t this be easy?)
- Change htaccess to redirect to index.php in subfolder
- Rewrite custom post type URL parameters
- How to remove wordpress directory slash
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- URL Rewriting for PHP script on an image URL
- Change pagination url format
- How to redirect specific URL to Subdomain
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- How to rewrite wordpress urls with index.php in them
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Map secondary domain to other’s virtual subfolder
- URL rewriting with custom user meta “/%shop_name%/gallery/%gallery%”
- Changing URL scheme, mod_rewrite not helping
- Localize URL bases
- How can I create custom URL routes?
- force www rewrite if wordpress put in a folder
- Rewriting a date hierarchy into a ‘yyyy-mm-dd’ slug
- How do I make WordPress revise an .htaccess file a certain way?
- modify URL with mod_rewrite or hook
- How to change an existing wordpress page rewrite rule?
- Pretty URL via Rewrite
- ModRewrite not working properly
- Custom Rewrite for Profiles
- Function to rewrite URl in WordPress
- help with rewrite_tag and rewrite_rule for custom page GET variables [duplicate]
- Can’t get pretty permalinks to work without index.php
- How to redirect a virtual page (e.g. /blog) to the home page?
- Please give me the rewrite rules for my ugly urls
- Add rewrite endpoint and .htaccess
- Is it possible to use the same slug structure for a taxonomy and for some pages?
- URL rewriting problem
- htaccess – Redirect to subfolder without changing browser URL
- Generic htaccess redirect www to non-www
- How do you create a “virtual” page in WordPress
- remove “index.php” from permalinks
- How to create a front end user profile with a friendly permalink
- Use a template file for a specific url without creating a page
- Using the Rewrite API to Construct a RESTful URL
- Does WordPress keep track of a post’s URL history and provide automatic redirects?
- Change the “page” slug in pagination
- Understanding add_rewrite_rule
- Override default url for author pages?
- web.config conflict on IIS
- Rewrite Slug for CPT Archive Pages to Plural Name of Slug
- Change author base slug for different roles
- Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?
- Using custom/dynamic “slug” for a page
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- Rewrite rules not working in WordPress
- How to retrieve $_GET variables from rewritten URLs?
- Dynamic Endpoints
- How to remove dates from existing permalinks?
- Passing parameters to a custom page template using clean urls
- rewrite rules and querystring
- Making a plugin file accessible via url rewrite?
- Adding rewrite endpoint breaks static front page
- How to add custom rewrite rule to .htaccess?
- How do I remove a rewrite rule?
- How do I add a server-independent external rewrite rule?
- Multiple endpoints to same page
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Use subdomain for certain urls
- Custom Permalinks for Blog Posts Only
- Unique URL Every Time
- generate_rewrite_rules (action) vs add_rewrite_rule (function): which one is preferred?
- Detect page type by url (Archive, single, page, author,…)
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- I want to create a custom slug in WordPress and output JSON. How do I do this?
- How to make a category page the blog home page?
- add_rewrite_rule: $matches var not replaced by captured value
- Can I call a custom plugin with a direct URL
- How to show the same content on multiple URLs?
- Custom slug in front of search URL
- Display posts with author in the url with custom post types
- Custom rewrite rules for pages
- Rewrite default post type
- Custom permalinks with NextGEN Gallery
- Clash of the rewrites
- Using a page template without a page
- External/non-WP rewrite rules
- How-to add rewrite rules to point the uploads folder to a subdomain
- Rewrite Rules for Multiple (more than 2) Taxonomies
- Create built-in pages without creating actual pages
- “.#[random-char-string]” being inserted at end of URLs