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
- htaccess – Redirect to subfolder without changing browser URL
- How to create a front end user profile with a friendly permalink
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- add_rewrite_rule() not playing nice with child pages
- rewrite_rule() not preserving the query string
- Appending numbers to url do not break the link
- How to Change Author Posts URL
- Change Attachment Post URLs to File URLs
- WordPress 404 unless there is a space in url
- Change permalink for default archive – yearly
- How to get “extended” path info from URL in a plugin
- Custom URL routing based on cookie value
- Rewriting rules: difference between ‘init’, ‘rewrite_rules_array’, ‘generate_rewrite_rules’?
- Remove Query String from URL on Redirect – Redirection Plugin
- WordPress Page Id
- Disable Pagination on Pages
- Rewriting a page with a custom parameter
- How to add a custom redirect rule for Post as subdomains?
- How to preserve the query string while using add_rewrite_rule and default public query vars
- How do I display only the parent page in the url
- Trying to find the location of a rewrite of the URL query
- How to use add_rewrite_rule in subdomain
- Why is WordPress rewriting absolute URLs on staging site to include staging prefix when we manually point them at the live site?
- How to create a URL Rewrite rule?
- Rewrite the default post object’s permalink
- WordPress search rewriting
- Enpoint Not Found in Rewrite Tag Permalink
- Custom Rewrite Rules
- URL Rewrite with Custom Variables
- Rewrite /category/cars into /topics/cars
- show ALL latest posts with archive.php on example.com/latest
- Adding a query string to only one page url
- Url rewrite with htaccess
- Current post ID – relative url
- How to use wp rewrite to hide form action url?
- Redirect URL to an existing page with query string or #! added on
- Add extra optional text to permalink e.g. “-with-*”
- remove archive from url :: marketpress
- add_rewrite_rule with optional parameters
- How to change url of specific posts with name of a root page
- Change author base and slug in author link
- Fresh install redirects to www, breaking page loads
- Rewrite Url using .htaccess or hook
- url restructure or rewrite having $_GET variables
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Error 404 wordpress redirecting URL
- What’s the best approach to do this?
- Font Page overrides rewrites
- WordPress Rewrite: Ignore Specific Pattern
- rewrite rule for home/index page
- Rewrite URL variable to custom path
- Own code on index.php wordpress theme file, help with the rewrite rules
- How to change search url produced by ‘s GET method?
- Hide / rewrite download link