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
- How to draw media details for Isotope gallery using Photoswipe
- Detect a focus on wp_editor
- Failed media upload: “The uploaded file was only partially uploaded.”
- retrieve thumbnail from post ID of best selling product in category
- Display a selected custom product option in WooCommerce cart
- Changing user_nicename
- How to create different menu’s for not logged in visitors and for logged in members?
- Utilize WP-CLI from inside WordPress, not SSH
- Using a function written in my functions.php file within the header.php file
- How to link to a custom .php page in my folder
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Sortable admin column for one meta key with three possible meta values
- WP_Query meta_query results date by date
- AJAX in WordPress, sending coords data to MySQL and show after into map
- Rewrite sub folder dynamically with country code in WordPress using PHP
- Display all categories including sub categories
- Is there a way to get 3+ dimensional array from a single MySql command
- How to add clearfix class according to to the posts number?
- Importing Geo data into wordpress database
- how to add three default images to wordpress?
- Loading the same WP_Query in two different wordpress .php templates
- foreach loop still echoes array
- dynamic dependent select dropdown
- Hide menu items in WordPress
- Best way to schedule daily change in CSS parameter
- WordPress Child Themes
- Email address not displaying where I expect it to
- Wrapping a Sidebar within
- Link blogname and blogdescription to the Options Framework
- Why does the post_type_link hook everything twice?
- Adding conditional text to a PHP Shortcode Template
- wp_nav_menu not working correctly in my underscores theme
- use loop to return blog details
- PHP error when using newer PHP versions
- fetch woocommerce product with custom taxonomy
- WP_Query with AJAX returning empty array
- How to add post meta in while loop?
- How can I Use 2 databases with one WordPress install
- How to set a featured image (thumbnail) with PHP?
- Output custom text field as unordered list
- Using Conditionals when homepage is a page and blog is /blog
- Can not call .php files after switching to %postname%
- WP Container Displaying Only on First Page of Archive
- Update Images after edit via php
- Drop down question
- custom mailchimp form using HTTP API
- WordPress Recent Posts – Loop
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Can’t add to time? [closed]
- not able to access $_POST on backend profile update
- WordPress Single Post Pagination Numbered and Navigational
- Displaying 3 Category Posts differently
- I changed the password for the database user of my website, updated wp-config.php and wordpress asks to be reinstalled
- Post formating on Home page
- Category – “No content found”
- How can I correctly POST to a WordPress page?
- WordPress – Image href for home menu nav not working
- Date when the custom field was added
- How do I call comments_template(); from a plugin file?
- How to return a Boolean for a page that is a subpage thru its name?
- php snippets in html are being commented out
- Can you not edit the HTML and PHP of your WordPress without paying?
- Why a class property becomes empty?
- how to goto specific page number including title with permalink
- get_the_term_list give me a whitespace