I'm trying to add the new rewrite rules using the rewrite API:
add_rewrite_rule('product/([A-Z0-9]{10})', 'index.php/product/?asin=$1', 'bottom');
add_rewrite_rule('product/(([A-Za-z0-9_])*)', 'index.php/product/?product=$1', 'bottom');
add_rewrite_rule('compare/((([A-Z0-9]{10}),?)*)', 'index.php/compare/?asin=$1', 'bottom');
add_rewrite_rule('categories/(([A-Za-z0-9]|\-|\_)*)', 'index.php/categories/?subcategory=$1', 'bottom');
After the permalink is updated it adds the following lines to the .htaccess
file:
RewriteRule ^product/([A-Z0-9]{10}) /index.php/product/?asin=$1 [QSA,L]
RewriteRule ^product/(([A-Za-z0-9_])*) /index.php/product/?product=$1 [QSA,L]
RewriteRule ^compare/((([A-Z0-9]{10}),?)*) /index.php/compare/?asin=$1 [QSA,L]
RewriteRule ^categories/(([A-Za-z0-9]|\-|\_)*) /index.php/categories/?subcategory=$1 [QSA,L]
resulting to the following .htaccess
file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^product/([A-Z0-9]{10}) /index.php/product/?asin=$1 [QSA,L]
RewriteRule ^product/(([A-Za-z0-9_])*) /index.php/product/?product=$1 [QSA,L]
RewriteRule ^compare/((([A-Z0-9]{10}),?)*) /index.php/compare/?asin=$1 [QSA,L]
RewriteRule ^categories/(([A-Za-z0-9]|\-|\_)*) /index.php/categories/?subcategory=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
But when I tried to access the following URL:
http://example.com/product/ABCDE324AB
It doesn't seem to work. I always get a page not found page. Any ideas?