Try this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_URI} ^/blog/.*$
RewriteRule /blog/?c=([^\&]*) $1 [L]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
# END WordPress
</IfModule>
Since RewriteBase
is defined, you shouldn’t have to specify /blog/ again in the redirection part.
RewriteEngine On
and RewriteBase
needn’t be repeated, not sure if repeating them causes problems.
Related Posts:
- mod_rewrite empties QUERY_STRING if starting with number [closed]
- Changing wp login url without plugin
- WordPress .htaccess rewrite for custom template
- WordPress and Htaccess
- Redirect URL Containing åäö
- What is the importance of mod_rewrite?
- 1 WordPress, 2 themes, 2 domains, 2 servers
- apache_mod_loaded setting can fubar plugins?
- How to stop rewrite from redirecting
- Block bad bots with mod_rewrite and save in blacklist
- why doesn’t my rewrite rule work? (is there something weird with wordpress htaccess?)
- How to remove .html from URL?
- How to enable mod_rewrite for Apache 2.2
- htaccess – Redirect to subfolder without changing browser URL
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- Apache mod_rewrite Infinite Loop when Accessing WordPress Admin Dashboard
- Masking wp-content/themes/name/images to just images directory using htaccess
- Making a plugin file accessible via url rewrite?
- How to change default page slug?
- 404 when fetching image from wp-content/uploads/
- How to map permalinks with accented letters to sanitized slugs?
- Mod_rewrite delete parameter in 301 Redirect
- Clean URLs for custom $_GET variables
- Sub domain redirection to taxonomy
- Need to make a php file inside theme accessible via url
- Custom domain for sub-section of parent website
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- Facebook sharer and parameters in URL
- Cache Busting using htaccess Rewrite rule?
- Evaluating a external rewrite rule before internal wordpress rewrite rule
- Remove File Extension for Page Outside of WordPress
- WordPress URL/Folder ReWrite using Htaccess
- WordPress mod_rewrite is canceling/overwriting my other mod_rewrite rule
- Using custom post type parent as slug
- How to protect media directory with .htaccess?
- Remove base slug in permalinks of hierarchical custom post type
- Rewrite Rules Are Redirecting and Not Passing VARs
- WordPress rewrite rules don’t need ^?
- Why is my mod_rewrite not working?
- Override htacces rule only for specific directory
- Adding rewrite rules directly to .htaccess file
- Custom rewrite not working
- .htaccess rule to redirect old URLs to new structure [closed]
- Add additional non-rewrite .htaccess directives on multisites via mod_rewrite_rules filter
- Only default permalink is working mod_rewrite enabled
- mod_rewrite loop, redirecting http to https on certain section of wordpress blog
- modrewrite not working on my Apache setup
- Need help with simple rewrite rule (shouldn’t this be easy?)
- blocking access to all post/tag URIs via htaccess
- Wrong Redirect/Rewrite Rules?
- Problem with change url for all subpages (.htaccess)
- Displaying Post with Custom URL with RewriteRule or add_rewrite_rule
- Why is the domain name missing from the logout redirect?
- How to remove specific category from URL in WordPress
- Redirections and rewrites to subdomain
- htaccess, site and staging in subdirectories
- How To Fix A Redirect Chain
- Custom Rewrite rule to captured post (rewrite rule to rewrite rule)
- Image URLs not redirecting properly
- 404 error Additionally 403 Forbidden error on a URL
- Map secondary domain to other’s virtual subfolder
- Can only access homepage and admin panel
- Pretty urls for custom pagination
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Loading index.php contents which located outside blog folder for post single page
- Why does WordPress redirect when I separate wp-core and wp-content?
- I have a page using a pretty url and a mod_rewrite rule matching it. I expected it to give an error but it’s working. Why?
- What to do when WordPress posts on a new server return an error 404
- Use the category name instead of category slug in permalinks
- Permalink sub-routing catch-all
- Rewrite rule and display of post
- force www rewrite if wordpress put in a folder
- WordPress rewrite does not work for some reason
- Simple seo-friendly custom $_GET url rewrite with htaccess
- Access posts while mod_rewrite is broken
- Types plugin breaking because of server configuration
- How do I make WordPress revise an .htaccess file a certain way?
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- Need Help with Custom ModRewrite
- How can I create a smarter .htaccess file that will add a directory?
- modify URL with mod_rewrite or hook
- Modifying WP URL handing code?
- Rewrite rules for custom post type
- Disable category RSS Feeds on WordPress blog with PHP
- Already have htaccess but permalink settings not working. Getting 404
- Static directories in a WordPress multisite network
- How to change an existing wordpress page rewrite rule?
- Can I add a rewrite rule in htaccess to remove the multisite subdirectory from the URL?
- using htaccess to check for cookie on permalink then conditionall rewrite with query parameter
- htaccess question and plugins.php
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- I can access subdirectory, but not files within it
- Pretty permalinks (again)
- htaccess mod_rewrite not working
- WordPress rewrite question
- Add-on domain works in WordPress but links still lead to subdomain
- WordPress home page showing 404 error
- Permalinks is not working in my wordpress setup
- Add rewrite endpoint and .htaccess
- Redirect, Change URLs or Redirect HTTP to HTTPS in Apache – Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask