apache - How to 301 redirect URL's with "index.php?" in a path? -
i trying redirect old urls this: mysite.com/index.php?dispatch=products.view&product_id=30176 new url's seo friendly , - mysite.com/category/product
i using cs-cart 4.3.1 seo add-on enabled, , when have imported products , categories urls automatically changed.
this add-on has 301 redirect functionality in admin, enables me create 301 redirects manually. however, wrong , doesn't work redirects have "index.php?" in path start with.
i have tried redirecting old urls without "index.php?" in path - like: "dispatch=products.view&product_id=30176" "mysite.com/category/product" , works, page being redirected. not correct url indexed google , need redirecting.
i suspect issue somewhere in rewrite conditions or rewrite rules on htaccess file created system upon activation of seo add-on.
this how looks like:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / options -multiviews rewriterule .* - [e=http_authorization:%{http:authorization}] rewritecond %{request_uri} ^api/(.*)$ [or] rewritecond %{request_uri} .*/api/(.*)$ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .*api/(.*)$ api.php?_d=$1 [l,qsa] rewritecond %{request_uri} \.(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff|yml|xml)$ [or] rewritecond %{request_uri} store_closed.html$ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*?)\/(.*)$ $2 [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l,qsa] </ifmodule>
if can think of reason why redirects not working when "index.php?" included in path, appreciate help.
the built-in "301 redirects" feature not support non-seo friendly urls old url parameter. means cannot use "index.php?dispatch=products.view&product_id=30176", can use "old_website_category/old_website_product" one.
to realize want, please add 301 redirects .htaccess file. e.g.
rewritecond %{query_string} ^product_id=30176$ rewriterule ^/?index\.php$ http://example.com/category/product? [l,r=301]
Comments
Post a Comment