Try using this:
if (!is_admin()) {
add_rewrite_rule('([A-Za-z0-9])/([A-Za-z0-9])', 'index.php/product?subcategory=$1&product=$2', 'top');
add_rewrite_rule('([A-Za-z0-9])', 'index.php/categories/?cat=$1', 'top');
}
Related Posts:
- Can I write ‘RewriteCond’ using ‘functions.php’?
- Prevent Buddypress Rewrite Rules on Non-Buddypress pages/posts
- Bypass .htaccess when using download_url
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- WordPress Rewrite API calls not creating new rules
- Newbie question: no index.php? in my plain wordpress permalink
- Static variable and add_rewrite_rule?
- Apache Fallback instead of add_rewrite_rule
- Performance impact of rewriting WordPress URLs
- Changes in permalink structure in WordPress and how to apply to in-site links
- WordPress Persistent connection rule does not work for “posts”
- Append query string to all URL’s
- custom rewrite rule help! Custom rewrite rules not applying to custom post type
- custom url rewrite for wordpress
- Loading index.php contents which located outside blog folder for post single page
- Create custom permalinks to show Custom Post Type’s relationship?
- How can I hide that I Use WordPress (with W3 Total Cache)
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- How to override url params with rewrite rules vars?
- Using rules in Posts
- Simple seo-friendly custom $_GET url rewrite with htaccess
- WordPress Rewrite Rule
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- Why is home page content not displaying with this rewrite rule?
- Modifying WP URL handing code?
- Disable category RSS Feeds on WordPress blog with PHP
- Change permalink structure specific category
- Rewrite rule for wp
- Rewrite /keyword1+keyword2.html to search page | .htaccess
- add_rewrite_rule questions
- rewrite_rule – working fine but broken for pagination
- Redirect homepage /page/1/ to /blog/page/1/
- WordPress rewrite question
- WordPress add parameters with friendly url structure
- add_rewrite_rule image from /images/site2/favicon.ico to /favico.ico
- Same Custom Post Type Slug and Custom Taxonomy Slug, with hierarchial unique permalink structure
- How to Dynamically Change the author_base URL Slug by Language in WordPress?
- How to ‘remember’ a site member’s last visited page?
- Rewrite url for custom post type not working
- I want my wordpress loop to only display posts of the standard format
- Adding instant search to wordpress page
- Best way to define a database with product codes and back-end support?
- If or/and statement advanced custom fields [closed]
- Remove duplicates from foreach
- Fluid Featured Post Carousel Slider for WordPress with no Javascript
- If Month=Particular month display content [closed]
- How to connect database table to each registered wordpress user.
- Setting pages for posts
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- How to exclude post from being queried based on custom meta value
- Problems with plugin that fetches data from database with ajax
- if conditional in sidebar plugin Password content shortcode
- WordPress – registering sidebar and adding a button directly after .textwidget
- How to get values from wordpress listings and use them in javascript array?
- Make an array listing custom taxonomy
- Get category id for a custom category and display it in a class
- Save data of select list after clicking save
- retrieve wordpress post-meta using php not wordpress functions
- Merge / Combine two php functions for Previous and Next Link with Thumbnail
- Migrate php folder to WordPress
- Automatically create a loop for post ID
- WP Knowledge Base Theme bug – Subcategories and Articles, Need to change WP_Query
- How to have Function of a plugin using global vars into a shortcode?
- set new link as permalink
- How to add a code for lastpostdate after/inside a specific menu link?
- Repeatable field within repeatable group of fields
- See output of a sql query while plugin installation in wordpress
- Shortcode Display From WordPress Dashboard Page Without Using post_id
- On selecting shortcode generate selected shortcode table inside page editor worrdpress
- Add php function into .js file (for tinyMCE button)
- Adding theme support for a custom header image
- Dynamic Post Type Variable echo as string?
- Undefined index notice when using the $args parameter in add_settings_field()
- Saving category as insert post
- WordPress plugin creating sidebar on the theme/page
- How do I / Is it possible to execute an external PHP file / function inside WordPress?
- Closed html class after counter = multiple of 3
- List sibling pages widget, exclude current page
- Ninja Forms – pull in some post related information
- Change taxonomy for categories
- Query category-specific, paginated posts and allow viewer to change sort order
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- Make first child link default instead of its parent
- How to save the output of php variables used in inline css code to the main style.css?
- Echo the featured image of page assigned to blog in index.php
- Limit ads appearing more than three times
- Functions are causing errors
- How to set a cookie based on a page Get variable?
- Select All not working in a WordPress search filter
- Editing the contents of just one div on a page from wordpress
- How to show all of aspecific post type that has taxonomy and a specific term
- Headers for Contact Form are wrong
- White screen after login attempt
- Insert wordpress tags below posts via functions.php
- Why this plugin is not working?
- Multiple URL from Custom post name
- Adding header function to theme
- Why isn’t my custom function kicking in from my functions.php file?
- Revision History for Entire WordPress Site
- Admin-area broken through weird issues