Firstly I'm no expert with mod rewrite but I have a URL I need to redirect.
The original URL is categories.asp?cat1=1&cat2=2&cat3=58&cat4=96
I need that to redirect to /store/browse/category/TRADITIONAL-BRIDGE-SINK-MIXER/product-details/1901-Traditional-Bridge-Sink-Mixer-NDSMC
Obviously there will be a lot of these to do and I'm happy enough to write each rule in turn.
I hope that makes sense.
Thanks in advance.
I guess there is much more to do and not only with mod_rewrite.
You first would need to achieve this:
TRADITIONAL-BRIDGE-SINK-MIXER
, keyword for that product will be 1901-Traditional-Bridge-Sink-Mixer-NDSMC
/store/browse/category/TRADITIONAL-BRIDGE-SINK-MIXER/product-details/1901-Traditional-Bridge-Sink-Mixer-NDSMC
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^store\/browse\/category\/(.*)\/product-details\/(.*)$ product.php?category_id=$1&product_id=$2 [QSA,L]
The same way for categories, lets say for a URL /store/browse/category/SINK-MIXER/TRADITIONAL-BRIDGE-SINK-MIXER/1901-Traditional-Bridge-Sink-Mixer-NDSMC
You would have a rule like:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^store\/browse\/category\/(.*)\/(.*)\/(.*)$ categories.php?category1_id=$1&category2_id=$2&category3_id=$3 [QSA,L]
This is not a solution, this is just a point to start from...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.