regex - Use .htaccess to redirect files beginning with certain criteria -


i'm moving website following big redesign , lot of url structures have changed. i've managed use .htaccess sort of redirects, i've got lot of pages need redirecting begin /shop.php?, e.g.:

/shop.php?search=as&x=0&y=0&sec=search&filter=price&filt_id=12&sort=asc&page=1
/shop.php?sec=cat&cat=13&filter=cat&filt_id=13

basically, need every file beginning /shop.php? redirecting /shop/

thanks in advance!

enable mod_rewrite , .htaccess through httpd.conf , put code in .htaccess under document_root directory:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewritecond %{query_string} ^.+$ rewriterule ^shop\.php$ /shop/? [l,r=301,nc] 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -