regex - PHP Variable to Wordpress shop page -


i have link:

http://www.ignitionmarketing.co.za/products_promodc.php?product_category=corporate+gifts 

i be:

http://www.ignitionmarketing.co.za/product-category/corporate-gifts/ 

also have tried normal way of:

redirect 301 /products_promodc.php?product_category=corporate+gifts http://www.ignitionmarketing.co.za/product-category/corporate-gifts/ 

but still stays on 404 page.

could please me?

added note:

i have couple of other links need redirected like:

/products_promodc.php?product_category=corporate+clothing  /products_promodc.php?product_category=corporate+clothing&product_subcategory=shirts 

the new wordpress shop have same categories well.

just better explanation solution. maybe come across similar issue in future.

i redirected "products_promodc.php" /product-category/ variable/parameter loaded behind (/product-category/corporate+clothing/) still gave me 404 error because of plus (+) within url. wrote rewriterule convert pluses (+) dashes!

much easier rewritematch cause problems subcategories.

rewriterule "^([^+]*)\++([^+]*\+.*)$" /$1-$2 [n] rewriterule "^([^+]*)\++([^+]*)$" /$1-$2 [l,r=301]  rewritecond %{query_string} product_category=([^&]+) [nc] rewritecond %{query_string} product_subcategory=([^&]+) [nc] rewriterule products_promodc\.php product-category/%1/? [l,r=301] 

i added second line subcategories load well!

working perfectly: http://www.ignitionmarketing.co.za/products_promodc.php?product_category=corporate+gifts


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -